Skip to content

Commit

Permalink
support for rails 3.2 adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
elie committed Jan 12, 2012
1 parent f196351 commit 77dac59
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/enum/enum_adapter.rb
@@ -1,11 +1,18 @@

# This module provides all the column helper methods to deal with the
# values and adds the common type management code for the adapters.


# try rails 3.1, then rails 3.2+, mysql column adapters
column_class = if defined? ActiveRecord::ConnectionAdapters::Mysql2Column
ActiveRecord::ConnectionAdapters::Mysql2Column
else
elsif defined? ActiveRecord::ConnectionAdapters::MysqlColumn
ActiveRecord::ConnectionAdapters::MysqlColumn
elsif defined? ActiveRecord::ConnectionAdapters::Mysql2Adapter::Column
ActiveRecord::ConnectionAdapters::Mysql2Adapter::Column
elsif defined? ActiveRecord::ConnectionAdapters::MysqlAdapter::Column
ActiveRecord::ConnectionAdapters::MysqlAdapter::Column
else
ObviousHint::NoMysqlAdapterFound
end

column_class.module_eval do
Expand Down

0 comments on commit 77dac59

Please sign in to comment.