aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures/topic.rb
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-09-17 09:29:02 +0000
committerMichael Koziarski <michael@koziarski.com>2007-09-17 09:29:02 +0000
commitacbec3e565909da5811488e88066a01f71b68a94 (patch)
tree3918c0ee69cdd55d82286de127c4f6bc2b0d27e4 /activerecord/test/fixtures/topic.rb
parentbfb906a905a1e8774e438b10e8cf703a829b55dc (diff)
downloadrails-acbec3e565909da5811488e88066a01f71b68a94.tar.gz
rails-acbec3e565909da5811488e88066a01f71b68a94.tar.bz2
rails-acbec3e565909da5811488e88066a01f71b68a94.zip
Ensure that custom mutators aren't redefined by define_attribute_methods. [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7500 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures/topic.rb')
-rwxr-xr-xactiverecord/test/fixtures/topic.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/fixtures/topic.rb b/activerecord/test/fixtures/topic.rb
index d7cd52e33e..dd71d6bf2b 100755
--- a/activerecord/test/fixtures/topic.rb
+++ b/activerecord/test/fixtures/topic.rb
@@ -13,8 +13,14 @@ class Topic < ActiveRecord::Base
def topic_id
id
end
+
protected
+ def approved=(val)
+ @custom_approved = val
+ write_attribute(:approved, val)
+ end
+
def default_written_on
self.written_on = Time.now unless attribute_present?("written_on")
end