Skip to content

Commit

Permalink
Rails 2.2 and 2.3 does not have ActiveSupport::Concern.
Browse files Browse the repository at this point in the history
  • Loading branch information
libc committed Feb 9, 2012
1 parent cc9383c commit e5f10b7
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/db_charmer/active_record/migration/multi_db_migrations.rb
Expand Up @@ -2,14 +2,19 @@ module DbCharmer
module ActiveRecord
module Migration
module MultiDbMigrations
extend ActiveSupport::Concern

included do
if DbCharmer.rails31?
alias_method_chain :migrate, :db_wrapper
else
class << self
def self.append_features(base)
return false if base < self
super
base.extend const_get("ClassMethods") if const_defined?("ClassMethods")

base.class_eval do
if DbCharmer.rails31?
alias_method_chain :migrate, :db_wrapper
else
class << self
alias_method_chain :migrate, :db_wrapper
end
end
end
end
Expand Down

0 comments on commit e5f10b7

Please sign in to comment.