On Jun 22, 5:18 pm, Alexander Trauzzi <rails-mailing-l...@andreas-
s.net> wrote:
> I want to decorate ActiveRecord with a new method so that any classes
> that inherit from it also have the method.
>
> I've been told that initializers are the way to go, yet when I put a
> file in initializers containing:
>
> class << ActiveRecord::Base
>
>    def methodName(params)
>    end
>
> end
>
Did you want to add a class method or were you intending to add an
instance method ?

Fred
> The method doesn't exist.  While I realize this may be the simplest of
> errors, I was going on some advice and I more or less would likely
> benefit of having a full explanation of what's going on with
> initializers, "class <<" and how the best way to add methods to
> ActiveRecord without actually modifying the ActiveRecord class itself...
> --
> 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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to