Displaying 2 results from an estimated 2 matches for "acts_as_something".
2007 Jan 17
1
include ClassMethods in plugins
...uding
acts_as_taggable by DHH):
# init.rb
ActiveRecord::Base.send(:include, ActiveRecord::Acts::SomeModule)
# lib/some_module.rb
module ActiveRecord
module Acts
module SomeModule
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def acts_as_something
# code
end
end
end
end
end
why go through all that rather than just call:
# init.rb
ActiveRecord::Base.extend ActiveRecord::Acts::SomeModule::ClassMethods
and skip the self.included method?
--~--~---------~--~----~------------~-------~--~----~
You received this me...
2008 Apr 01
1
plugin announcement: acts_as_fu
...ow what they''re looking for.
Rockstars. Code Monkeys. Rails Ninjas.
And you''re left thinking, "But I''m just a programmer." Well, not
anymore. Today, you become a Rails Kung-Fu Master!
"Not me," you say. "I''ve already tried using all the acts_as_something
plugins and all the something_fu plugins; and I''m still not a Rockstar
or a Ninja. I''m barely a Code Simian!"
Sounds like you''ve tried the rest - now try the best! That''s right:
it''s the new and improved ActsAsFu Rails plugin!
Three Easy Steps to...