aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/fixtures/mixin.rb8
-rw-r--r--activerecord/test/mixin_test.rb10
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