Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Rails 3.2 Compatibility #9

Merged
merged 1 commit into from

3 participants

@mrzor

Adapter name changed a bit. Support for < 3.2 is unchanged.

@electronick electronick merged commit af3b480 into electronick:master
@mrzor

Cheers

@kreeger

Ah, thank you! I was just about to open a ticket and do a pull request myself. Could this, per chance, be versioned up and posted to RubyGems?

@electronick
Owner

[to kreeger] yep, sure. I'll publish new gem version soon with other fixes.

@kreeger

@electronick Thanks… you rock!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 12, 2012
  1. @mrzor

    support for rails 3.2 adapters

    mrzor authored
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 2 deletions.
  1. +9 −2 lib/enum/enum_adapter.rb
View
11 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
Something went wrong with that request. Please try again.