Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Since we're using Inflector, use #constantize to find the right adapter

  • Loading branch information...
commit 5f1454e4f7aeb9df4092d98640c2ee0910426a75 1 parent c54d7d6
Scott Burton authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/badgeable/adapters.rb
View
4 lib/badgeable/adapters.rb
@@ -14,8 +14,8 @@ def self.supported_adapters
end
def self.connect(klass)
- raise ArgumentError, "Badgeable needs a database adapter to work. Add one of the following to your Gemfile: #{Badgeable::Adapters.supported_adapters.map {|name| 'badgeable_' + name }}" unless Badgeable::Adapters.current && (Badgeable::Adapters.supported_adapters.include? Badgeable::Adapters.current)
- klass.send(:include, Badgeable::Adapters.const_get(Badgeable::Adapters.current.titleize + "Adapter" ))
+ raise ArgumentError, "Badgeable needs a database adapter to work. Add one of the following to your Gemfile: #{Badgeable::Adapters.supported_adapters.map {|name| 'badgeable_' + name }}" unless Badgeable::Adapters.current_adapter && (Badgeable::Adapters.supported_adapters.include? Badgeable::Adapters.current_adapter)
+ klass.send(:include, "Badgeable::Adapters::#{current_adapter.to_s.camelize}Adapter".constantize)
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.