I''ve searched on the net and found others have used mixins with AR in
various ways.
I''ve done the following:
File: ../models/my_mod.rb
module MyMod
def self.doit
end
end
File: ../models/my_model.rb
class MyModel < ActiveRecord::Base
include MyMod
def do_this
end
end
I believe I am using Mixins correctly, but it seems AR behaves differently.
I am getting a NoMethodError with ''method_missing'' when I try
to use
MyModel.doit
in a controller. What am I missing? Is this the side-effect of AR''s use
of
''method_missing'' to generate accessors dynamically?
Thanks for any thoughts,
Long
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---