spec/models.rb in active_null-0.0.6 vs spec/models.rb in active_null-1.0.0

- old
+ new

@@ -8,17 +8,22 @@ end end class MicroPost < Post extend ActiveNull - null_model end +class User < ActiveRecord::Base + extend ActiveNull + has_many :comments, as: :author +end + class Comment < ActiveRecord::Base extend ActiveNull belongs_to :post - null_model + belongs_to :author, polymorphic: true + null_defaults_for_polymorphic author: 'User' end class NullPostDecorator < Draper::Decorator delegate_all end @@ -28,8 +33,7 @@ end module Test class TestModel < ActiveRecord::Base extend ActiveNull - null_model end end