diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-16 15:21:16 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-16 15:21:16 +0000 |
commit | c5d6aa2b18a0c52ffdad6f1ebdb828e326128612 (patch) | |
tree | 40d3c6782fcdbabddac9bfa18ccec5d90e0d6da9 /activerecord/test | |
parent | 87297f1c4be22c10de138709ba2d6c3ace4b0117 (diff) | |
download | rails-c5d6aa2b18a0c52ffdad6f1ebdb828e326128612.tar.gz rails-c5d6aa2b18a0c52ffdad6f1ebdb828e326128612.tar.bz2 rails-c5d6aa2b18a0c52ffdad6f1ebdb828e326128612.zip |
Added option for turning off the automated timestamps
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@184 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/fixtures/mixin.rb | 8 | ||||
-rw-r--r-- | activerecord/test/mixin_test.rb | 10 |
2 files changed, 12 insertions, 6 deletions
diff --git a/activerecord/test/fixtures/mixin.rb b/activerecord/test/fixtures/mixin.rb index 0c3bf5000a..1b6099901f 100644 --- a/activerecord/test/fixtures/mixin.rb +++ b/activerecord/test/fixtures/mixin.rb @@ -6,16 +6,12 @@ end class ListMixin < ActiveRecord::Base acts_as_list :column => "pos", :scope => :parent - def self.table_name - "mixins" - end + def self.table_name() "mixins" end end class ListWithStringScopeMixin < ActiveRecord::Base acts_as_list :column => "pos", :scope => 'parent_id = #{parent_id}' - def self.table_name - "mixins" - end + def self.table_name() "mixins" end end
\ No newline at end of file diff --git a/activerecord/test/mixin_test.rb b/activerecord/test/mixin_test.rb index 58e7ff1807..72be561f59 100644 --- a/activerecord/test/mixin_test.rb +++ b/activerecord/test/mixin_test.rb @@ -125,4 +125,14 @@ class TouchTest < Test::Unit::TestCase assert_not_nil @obj.updated_at assert_not_nil @obj.created_at end + + def test_create_turned_off + Mixin.record_timestamps = false + + assert_nil @first.updated_at + @first.save + assert_nil @first.updated_at + + Mixin.record_timestamps = true + end end |