Displaying 2 results from an estimated 2 matches for "my_new_method".
Did you mean:
dh_new_method
2006 Feb 08
3
Extends ActiveRecord from the application ?
Hello,
I just want to create a method that will be available for all models. Is
it possible ?
2006 Jan 02
0
Extending a model in a component...
...'m missing something basic, but I need help understanding
something:
I have a model (User) sitting in a component. I want to extend that
model from my app. I need to add in a has_many relationship and a
couple of methods.
I was able to mixin the methods using this:
module MyUser
def my_new_method
# etc
end
end
User.send(:include, MyUser::Acts::Chicken)
This just mixes in the new method. But if I add a ''has_many'', I get
an error.
I''ve tried using the way to extend ActiveRecord (like in a plugin),
but that''s not working either.
module MyUser...