On Oct 7, 7:19 pm, Vidmantas Kabošis <[EMAIL PROTECTED]
s.net> wrote:
> Hello,
>
> I'm trying to develop a ActiveRecord plugin but run into the following
> problem: I pass arguments to
>
>  write_inheritable_attribute :some_field, 'value'
>  class_inheritable_reader    :some_field
>
> in ClassMethods module and I'm available to get them in InstanceMethods
> with self.class.some_field. But when I try to do like this:
>

I may not be reading you correctly, but at that point do you not need
to be using self.some_field ? (self.class.some_field would be trying
to find that method on Class or something like that.

Fred

> define_method "#{self.class.some_field}"
> ...
>
> or
>
> class_eval <<-eval
>   def #{self.class.some_field}
>    ...
>   end
> eval
>
> I get NoMethodError: undefined method `some_field' for Module:Class
>
> Anybody could help with this?
> --
> Posted viahttp://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