aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-06-07 04:28:23 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-06-07 04:28:23 +0900
commit48c95cf7e591ed3b683705ded92c6d7c7518aaec (patch)
tree708b0f3732c82a33c099588f007bc50502bb4975 /activerecord/test/models
parent86e42b53662f535ee484630144e27ee684e8e8dc (diff)
downloadrails-48c95cf7e591ed3b683705ded92c6d7c7518aaec.tar.gz
rails-48c95cf7e591ed3b683705ded92c6d7c7518aaec.tar.bz2
rails-48c95cf7e591ed3b683705ded92c6d7c7518aaec.zip
Reuse existing model for testing duplicated children records
Follow up of #32952.
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/reply.rb5
-rw-r--r--activerecord/test/models/topic.rb1
2 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/test/models/reply.rb b/activerecord/test/models/reply.rb
index d178413fd7..0ea110f4f8 100644
--- a/activerecord/test/models/reply.rb
+++ b/activerecord/test/models/reply.rb
@@ -6,6 +6,7 @@ class Reply < Topic
belongs_to :topic, foreign_key: "parent_id", counter_cache: true
belongs_to :topic_with_primary_key, class_name: "Topic", primary_key: "title", foreign_key: "parent_title", counter_cache: "replies_count", touch: true
has_many :replies, class_name: "SillyReply", dependent: :destroy, foreign_key: "parent_id"
+ has_many :silly_unique_replies, dependent: :destroy, foreign_key: "parent_id"
end
class UniqueReply < Reply
@@ -14,10 +15,6 @@ class UniqueReply < Reply
end
class SillyUniqueReply < UniqueReply
-end
-
-class ValidateUniqueContentReply < Reply
- belongs_to :topic, foreign_key: "parent_id"
validates :content, uniqueness: true
end
diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb
index 8368405cef..72699046f9 100644
--- a/activerecord/test/models/topic.rb
+++ b/activerecord/test/models/topic.rb
@@ -47,7 +47,6 @@ class Topic < ActiveRecord::Base
has_many :unique_replies, dependent: :destroy, foreign_key: "parent_id"
has_many :silly_unique_replies, dependent: :destroy, foreign_key: "parent_id"
- has_many :validate_unique_content_replies, dependent: :destroy, foreign_key: "parent_id"
serialize :content