aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/topic.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-09-10 09:41:42 +0100
committerJon Leighton <j@jonathanleighton.com>2011-09-13 00:01:58 +0100
commit8667d3aeb64dd8dba463ace364534326411bb46c (patch)
tree11b88f7a1f7171a753832f5ddc2a7d8069660993 /activerecord/test/models/topic.rb
parent3386a089eff05a8a990ca56909c9a427f4f2fe25 (diff)
downloadrails-8667d3aeb64dd8dba463ace364534326411bb46c.tar.gz
rails-8667d3aeb64dd8dba463ace364534326411bb46c.tar.bz2
rails-8667d3aeb64dd8dba463ace364534326411bb46c.zip
Make protected method public so we avoid method_missing.
Diffstat (limited to 'activerecord/test/models/topic.rb')
-rw-r--r--activerecord/test/models/topic.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb
index 6440dbe8ab..fe424e61b2 100644
--- a/activerecord/test/models/topic.rb
+++ b/activerecord/test/models/topic.rb
@@ -78,11 +78,12 @@ class Topic < ActiveRecord::Base
after_initialize :set_email_address
+ def approved=(val)
+ @custom_approved = val
+ write_attribute(:approved, val)
+ 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")