aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2016-01-23 08:42:40 -0700
committerSean Griffin <sean@seantheprogrammer.com>2016-01-23 08:44:16 -0700
commit67c1719012506c3387df067961252b5df50a97ce (patch)
tree98daecc48f5df488d8e2147e51a71d4b07d2cd6f /activerecord/test/schema
parent8de32bb25295787b68d307c74e50462cd99e6ecc (diff)
downloadrails-67c1719012506c3387df067961252b5df50a97ce.tar.gz
rails-67c1719012506c3387df067961252b5df50a97ce.tar.bz2
rails-67c1719012506c3387df067961252b5df50a97ce.zip
Use the database type to deserialize enum
This fixes incorrect assumptions made by e991c7b that we can assume the DB is already casting the value for us. The enum type needs additional information to perform casting, and needs a subtype. I've opted not to call `super` in `cast`, as we have a known set of types which we accept there, and the subtype likely doesn't accept them (symbol -> integer doesn't make sense) Close #23190
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r--activerecord/test/schema/schema.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index 025184f63a..2e1e584156 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -104,6 +104,7 @@ ActiveRecord::Schema.define do
t.column :author_visibility, :integer, default: 0
t.column :illustrator_visibility, :integer, default: 0
t.column :font_size, :integer, default: 0
+ t.column :cover, :string, default: 'hard'
end
create_table :booleans, force: true do |t|