-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
<pre>
class Place
include Mongoid::Document
embedded_in :anchor, :inverse_of => :places
key :coord, :type => Array
key :name, :type => String
key :desc, :type => String
key :address1, :type => String
key :address2, :type => String
key :city, :type => String
key :zipcode, :type => Integer
key :web_link, :type => String
referenced_in :user, :inverse_of => :places
embeds_many :comments
before_save :get_location
def get_location
self.coord = [42.01937, -87.67328]
end
end
</pre>
When trying to run this callback, you get:
<pre>
Undefined method coord= for .... </pre>