diff options
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/reply.rb | 6 |
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 |