aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/type
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/type
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/type')
-rw-r--r--activerecord/test/cases/type/integer_test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/type/integer_test.rb b/activerecord/test/cases/type/integer_test.rb
index 0c60f0690c..1e836f2142 100644
--- a/activerecord/test/cases/type/integer_test.rb
+++ b/activerecord/test/cases/type/integer_test.rb
@@ -113,7 +113,7 @@ module ActiveRecord
test "values which are out of range can be re-assigned" do
klass = Class.new(ActiveRecord::Base) do
self.table_name = 'posts'
- attribute :foo, Type::Integer.new
+ attribute :foo, :integer
end
model = klass.new