I want to add an association to my Comment
class from a different location than comment.rb
, e.g. in an initializer. Something like:
# in config/initializers/comment_setup.rb
class Comment < ActiveRecord::Base
has_many :replies
end
But when I try this (rails 2.3.4) I get an error that the has_many association does not exist.
What's the best way to re-open an ActiveRecord class from a location other than app/models/blah.rb
?