test/fixtures/article.rb in composite_primary_keys-9.0.4 vs test/fixtures/article.rb in composite_primary_keys-9.0.5
- old
+ new
@@ -1,5 +1,6 @@
-class Article < ActiveRecord::Base
- has_many :readings, :dependent => :delete_all
- has_many :users, :through => :readings
-end
-
+class Article < ActiveRecord::Base
+ validates :id, uniqueness: true, numericality: true, allow_nil: true, allow_blank: true, on: :create
+ has_many :readings, :dependent => :delete_all
+ has_many :users, :through => :readings
+end
+