aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/reply.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-01 03:20:38 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-01 03:20:38 +0100
commit8c5fe60ec82986ab4aa337a69c2ab753f518976d (patch)
tree13ac7474bd3da7b26d7aef896bf98951bffdeeee /activerecord/test/models/reply.rb
parent50fbb7405665ba1c2b7c6f23574053a4764cef7f (diff)
downloadrails-8c5fe60ec82986ab4aa337a69c2ab753f518976d.tar.gz
rails-8c5fe60ec82986ab4aa337a69c2ab753f518976d.tar.bz2
rails-8c5fe60ec82986ab4aa337a69c2ab753f518976d.zip
Simplify repair_validations on AR and make it work with new callbacks.
Diffstat (limited to 'activerecord/test/models/reply.rb')
-rw-r--r--activerecord/test/models/reply.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/models/reply.rb b/activerecord/test/models/reply.rb
index ba5a1d1d01..f1ba45b528 100644
--- a/activerecord/test/models/reply.rb
+++ b/activerecord/test/models/reply.rb
@@ -7,11 +7,13 @@ class Reply < Topic
belongs_to :topic_with_primary_key, :class_name => "Topic", :primary_key => "title", :foreign_key => "parent_title", :counter_cache => "replies_count"
has_many :replies, :class_name => "SillyReply", :dependent => :destroy, :foreign_key => "parent_id"
+ attr_accessible :title, :author_name, :author_email_address, :written_on, :content, :last_read, :parent_title
+end
+
+class WrongReply < Reply
validate :errors_on_empty_content
validate :title_is_wrong_create, :on => :create
- attr_accessible :title, :author_name, :author_email_address, :written_on, :content, :last_read, :parent_title
-
validate :check_empty_title
validate :check_content_mismatch, :on => :create
validate :check_wrong_update, :on => :update