public
Description: Who's your daddy? Kill Rails fixtures, Don't Repeat Yourself, reduce the complexity of your tests.
Homepage: http://tasks.ogtastic.com/projects/show/object-daddy
Clone URL: git://github.com/flogic/object_daddy.git
Search Repo:
object_daddy / init.rb
100644 12 lines (11 sloc) 0.365 kb
1
2
3
4
5
6
7
8
9
10
11
12
unless ActiveRecord::Base.respond_to? :inherited_with_object_daddy
  class ActiveRecord::Base
    def self.inherited_with_object_daddy(subclass)
      self.inherited_without_object_daddy(subclass)
      subclass.send(:include, ObjectDaddy) unless subclass < ObjectDaddy
    end
 
    class << self
      alias_method_chain :inherited, :object_daddy
    end
  end
end