aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-02-11 15:14:21 -0700
committerSean Griffin <sean@thoughtbot.com>2015-02-11 15:14:21 -0700
commit933decceaf6092020ba7ba768b51b2db9d5b882f (patch)
tree5a53a0cc73be95e40003e50f33448c5bdc7755ef
parentc51f9b61ce1e167f5f58f07441adcfa117694301 (diff)
downloadrails-933decceaf6092020ba7ba768b51b2db9d5b882f.tar.gz
rails-933decceaf6092020ba7ba768b51b2db9d5b882f.tar.bz2
rails-933decceaf6092020ba7ba768b51b2db9d5b882f.zip
Don't break enum on PG
-rw-r--r--activerecord/lib/active_record/enum.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/enum.rb b/activerecord/lib/active_record/enum.rb
index b70d52aa87..3086f13f96 100644
--- a/activerecord/lib/active_record/enum.rb
+++ b/activerecord/lib/active_record/enum.rb
@@ -98,7 +98,7 @@ module ActiveRecord
end
def type_cast_from_database(value)
- mapping.key(value)
+ mapping.key(value.to_i)
end
def type_cast_for_database(value)