Saty Nos wrote:
> By looking at the implementation of class_inheritable_accessor by
> ActiveSupport, looks like it is defining not only class methods as well
> as instance methods. Whats the reason behind defining both class level
> as well as instance level methods. Is there any alternative function
> that defines just the class level methods.
> 
> Please see below for my requirement:
> 
> I have a model Page for which I would like to define class level
> variable "title" that can be overridden in its subclasses. But I also
> have a column in the pages table by the name "title". But by using
> class_inheritable_accessor, I am getting nil for @page.title.
> 
> Thanks in advance.

Declaring remove_method after the declaration of 
class_inheritable_accessor seems to do the trick, although not sure 
about the ramifications at this point, partly due to the lack of 
knowledge of why rails is defining the instance methods in the first 
place. Would appreciate if someone could shed the light.

-Satynos
-- 
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 [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