Skip to content

Commit

Permalink
Fix adapter constant finding for Rails 4.1+
Browse files Browse the repository at this point in the history
  • Loading branch information
bf4 committed Jul 17, 2015
1 parent 8de4f25 commit bb5b39c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/active_model/serializer/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ def get(adapter)
end

def find_by_name(adapter_name)
self.constants.find {|adapter_klass|
adapter_const = self.constants.find {|adapter_klass|
adapter_klass.to_s.downcase.underscore === adapter_name
}
adapter_const && self.const_get(adapter_const.to_sym)
end
private :find_by_name

Expand Down

0 comments on commit bb5b39c

Please sign in to comment.