In my project, I've created an abstract model that my real models
inherit from.  In my abstract model, I've overridden method_missing so
that I can use attribute names without the field type prefix from the
legacy database, without having to set up alias_attribute for every
attribute in every table.


class LegacyModel < ActiveRecord::Base
  self.abstract_class = true

  def method_missing(symbol, *args)
    ...do some stuff...
  end
end


This all worked fine in Rails 2.0.2.  It still works in Rails 2.2.2,
but now not across a belongs_to association.  It does work across a
has_many association.

NoMethodError: NoMethodError
        from /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/
associations/association_proxy.rb:209:in `method_missing'


Anyone have any ideas on either a better way to handle the attribute
names, or where to start looking to figure out how to make this work?

Thanks,

Jim Crate
Que Viva, LLC


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to