From 524f2f142b34b8f3c05d3d1b0910e7f0e5579936 Mon Sep 17 00:00:00 2001 From: Rob Chekaluk Date: Sun, 23 Feb 2014 08:19:01 -0500 Subject: [PATCH] Rails 4; permit 2 arguments to ActiveRecord::Persistence::ClassMethods. Supports https://github.com/jeffp/enumerated_attribute/issues/66 --- lib/enumerated_attribute/integrations/active_record.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/enumerated_attribute/integrations/active_record.rb b/lib/enumerated_attribute/integrations/active_record.rb index 04399f4..d3107df 100644 --- a/lib/enumerated_attribute/integrations/active_record.rb +++ b/lib/enumerated_attribute/integrations/active_record.rb @@ -71,7 +71,7 @@ def []=(attr_name, value); write_enumerated_attribute(attr_name, value); end def attribute=(attr_name, value); write_enumerated_attribute(attr_name, value); end module ClassMethods - def instantiate(record) + def instantiate(record, column_types = {}) object = super(record) self.enumerated_attributes.each do |k,v| unless object.has_attribute?(k) #only initialize the non-column enumerated attributes