aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorDmitry Polushkin <dmitry.polushkin@gmail.com>2011-09-15 09:39:26 +0100
committerDmitry Polushkin <dmitry.polushkin@gmail.com>2011-09-15 09:39:26 +0100
commit9d54f8994d09db5435d6c234430ae13333928fb9 (patch)
tree12413c10ed50c181f5bea0980edca998e72969bb /activerecord/test/models
parentedd2f21e8095fe4a38e812025b4d9fd0e0cc28f1 (diff)
parentda7f0426ec7b0aa053489633c2a8a3da6423654f (diff)
downloadrails-9d54f8994d09db5435d6c234430ae13333928fb9.tar.gz
rails-9d54f8994d09db5435d6c234430ae13333928fb9.tar.bz2
rails-9d54f8994d09db5435d6c234430ae13333928fb9.zip
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/contact.rb13
-rw-r--r--activerecord/test/models/topic.rb9
2 files changed, 12 insertions, 10 deletions
diff --git a/activerecord/test/models/contact.rb b/activerecord/test/models/contact.rb
index e081eee661..3d15c7fbed 100644
--- a/activerecord/test/models/contact.rb
+++ b/activerecord/test/models/contact.rb
@@ -11,12 +11,13 @@ class Contact < ActiveRecord::Base
connection.merge_column('contacts', name, sql_type, options)
end
- column :name, :string
- column :age, :integer
- column :avatar, :binary
- column :created_at, :datetime
- column :awesome, :boolean
- column :preferences, :string
+ column :name, :string
+ column :age, :integer
+ column :avatar, :binary
+ column :created_at, :datetime
+ column :awesome, :boolean
+ column :preferences, :string
+ column :alternative_id, :integer
serialize :preferences
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")