Simon Baumgartner wrote in post #968527:
> A comment about your Location model:
>
> You rarely need 'initialize' when creating new model instances (and in
> this case you don't).
Good catch! But make that "never", not "rarely". ActiveRecord
constructors generally shouldn't be overridden. Instead, use before_ or
after_create callbacks to set values (as in your example).
> The beauty of ActiveRecord is that it automagically gives you instance
> variables for all table columns.
> If you need any variables that are not a table column use
> attr_accessor :foo_bar
>
> Also, for all geocoding needs I would use http://geokit.rubyforge.org/
Indeed. Also investigate Spatial Adapter, and consider PostGIS if
you're using PostgreSQL. (If you're not using PostgreSQL, you probably
should be. :) )
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
--
Posted via http://www.ruby-forum.com/.
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment