Permalink
Browse files

Rails 2.2 and 2.3 does not have ActiveSupport::Concern.

  • Loading branch information...
1 parent cc9383c commit e5f10b79578148500cf6139615f5a99a86aa4620 @libc committed Feb 9, 2012
Showing with 11 additions and 6 deletions.
  1. +11 −6 lib/db_charmer/active_record/migration/multi_db_migrations.rb
@@ -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

0 comments on commit e5f10b7

Please sign in to comment.