20 Jul 02:42
looking up accessor methods for ActiveRecord objects
From: Erik Rantapaa <rails-mailing-list@...>
Subject: looking up accessor methods for ActiveRecord objects
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-07-20 00:44:35 GMT
Subject: looking up accessor methods for ActiveRecord objects
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-07-20 00:44:35 GMT
Hi, I am trying to invoke a method on an ActiveRecord object using something like: k = :date= obj.method(k).call(new_date) Initially obj.method(k) is throwing a NameError. However, if I first explicitly invoke _any_ accessor method, then the above works as expected: obj.date # just get the date k = :date= obj.method(k).call(new_date) # works now Is there a good way to ensure that these accessor methods are loaded before I try looking them up with .method()? Thanks, Erik -- -- 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@... To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@...(Continue reading)
RSS Feed