aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/dirty_test.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-02-06 11:05:38 -0700
committerSean Griffin <sean@thoughtbot.com>2015-02-06 11:51:13 -0700
commit101c19f55f5f1d86d35574b805278f11e9a1a48e (patch)
treecf5821f06acafe416a0cea205967f243f08ec9ef /activerecord/test/cases/dirty_test.rb
parentd7318599160dbc6d362793673e8c6db926eeb7b8 (diff)
downloadrails-101c19f55f5f1d86d35574b805278f11e9a1a48e.tar.gz
rails-101c19f55f5f1d86d35574b805278f11e9a1a48e.tar.bz2
rails-101c19f55f5f1d86d35574b805278f11e9a1a48e.zip
Allow a symbol to be passed to `attribute`, in place of a type object
The same is not true of `define_attribute`, which is meant to be the low level no-magic API that sits underneath. The differences between the two APIs are: - `attribute` - Lazy (the attribute will be defined after the schema has loaded) - Allows either a type object or a symbol - `define_attribute` - Runs immediately (might get trampled by schema loading) - Requires a type object This was the last blocker in terms of public interface requirements originally discussed for this feature back in May. All the implementation blockers have been cleared, so this feature is probably ready for release (pending one more look-over by me).
Diffstat (limited to 'activerecord/test/cases/dirty_test.rb')
-rw-r--r--activerecord/test/cases/dirty_test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/dirty_test.rb b/activerecord/test/cases/dirty_test.rb
index 192ba6f7cd..c2573ac72b 100644
--- a/activerecord/test/cases/dirty_test.rb
+++ b/activerecord/test/cases/dirty_test.rb
@@ -711,7 +711,7 @@ class DirtyTest < ActiveRecord::TestCase
test "attribute_will_change! doesn't try to save non-persistable attributes" do
klass = Class.new(ActiveRecord::Base) do
self.table_name = 'people'
- attribute :non_persisted_attribute, ActiveRecord::Type::String.new
+ attribute :non_persisted_attribute, :string
end
record = klass.new(first_name: "Sean")