hello…
i am currently trying to use :through to attach two of my models
together using geokit. for some reason, i am running into a problem:
ArgumentError: Unknown key(s): as
i have two models, one that is geocoded, and one that belongs to that
model. the models look like:
,----[ employer.rb ]
| class Employer < ActiveRecord::Base
| acts_as_mappable
| before_validation_on_create :geocode_address
|
| has_many :internships
| belongs_to :account
| belongs_to :role
|
| private
| def geocode_address
| geo=GeoKit::Geocoders::MultiGeocoder.geocode(address1 + " " + city + " " + state + " " + zip)
| errors.add(:address, “Could not Geocode address”) if !geo.success
| self.lat, self.lng = geo.lat,geo.lng if geo.success
| end
|
| end
`----
and an internship:
,----[ internship.rb ]
| class Internship < ActiveRecord::Base
| has_many :internship_categories
| belongs_to :employer, :polymorphic => true
| acts_as_mappable :through => :employer
| end
`----
it seems like there is an intermediary object in the docuements called
‘:locatable’ that connects the the two together, but i just can’t get
how that is being called, or what i am supposed to do with it.
no matter where i put it, i end up with this error:
ArgumentError: Unknown key(s): as
if i remove: “:as => :locatable” i end up with a problem in that the
model doesn’t have :lat or :lng, which makes me think that
the :through is not working at all.
please let me know how to attack this…
thanks!