On Fri, Apr 15, 2011 at 10:53 PM, Fearless Fool <[email protected]>wrote:
> Perhaps this is just > http://www.ruby-forum.com/topic/1505406 > coming back to bite me -- I suspect I'm missing a trivial declaration. > > ==== Error message (note that NOAA is an STI subclass of WeatherStation) > > ActiveRecord::AssociationTypeMismatch (WeatherStation(#2169635200) > expected, got NOAA(#2185634180)): > > ==== Source of the error (station is, in fact, an NOAA object) > > PremiseWeatherStation.create(:premise => self, :weather_station => > station) > > I've been unable to reproduce your error in the rails server or in the console. However, what I do see is that "self" is a reserved word. The variable name of the object you want to pass in should not be called "self". When I used your statement as is I received a different TypeMismatch error; it was for Premise because self was passing in PremiseWeatherStation. My only suggestion right now is to change the variable name being passed into :premise => to something else and try your statement again. B. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

