Permalink
Browse files

support for rails 3.2 adapters

  • Loading branch information...
elie
elie committed Jan 12, 2012
1 parent f196351 commit 77dac597b221ea1e2fe8b4ac71299687821d7ecc
Showing with 9 additions and 2 deletions.
  1. +9 −2 lib/enum/enum_adapter.rb
View
@@ -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

0 comments on commit 77dac59

Please sign in to comment.