Created
May 21, 2014 22:43
-
-
Save dmitry/b94860e44516e417f6f4 to your computer and use it in GitHub Desktop.
Revisions
-
dmitry created this gist
May 21, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ ActiveRecord::Base.module_eval do class << self def inherited_with_paper_trail(subclass) skip_models = %w(schema_migrations versions) inherited_without_paper_trail(subclass) table_name = subclass.table_name if !skip_models.include?(table_name) && table_name.present? subclass.send(:has_paper_trail) end end alias_method_chain :inherited, :paper_trail end end