Class A and B are identical:
class A < ActiveRecord::Base
def foo
puts \"foo\"
end
end
class B < ActiveRecord::Base
def foo
puts \"foo\"
end
end
<
It depends on what you are really trying to do.
respond_to
foo
.foo
. This is pretty much what all those acts_as_
plugins do.Bottom line, if you want every single model to have a different behavior to what ActiveRecord::Base already provides, use option 1. If only a handful of your models require the behavior, create a module and include it in your models (option 3).