Sha256: 4ae1102914dc6f3db1667533e3a373fc8a2d5606e46747a4d1cc1baa882a00e2

Contents?: true

Size: 820 Bytes

Versions: 8

Compression:

Stored size: 820 Bytes

Contents

module SchemaMonkey
  module ActiveRecord

    module Base
      def self.included(base)
        base.extend(ClassMethods)
      end

      module ClassMethods
        def self.extended(base)
          class << base
            alias_method_chain :columns, :schema_monkey
            alias_method_chain :reset_column_information, :schema_monkey
          end
        end

        def columns_with_schema_monkey
          Middleware::Model::Columns.start model: self, columns: [] do |env|
            env.columns += columns_without_schema_monkey
          end
        end

        def reset_column_information_with_schema_monkey
          Middleware::Model::ResetColumnInformation.start model: self do |env|
            reset_column_information_without_schema_monkey
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
schema_monkey-0.4.1 lib/schema_monkey/active_record/base.rb
schema_monkey-0.4.0 lib/schema_monkey/active_record/base.rb
schema_monkey-0.3.2 lib/schema_monkey/active_record/base.rb
schema_monkey-0.3.1 lib/schema_monkey/active_record/base.rb
schema_monkey-0.3.0 lib/schema_monkey/active_record/base.rb
schema_monkey-0.2.0 lib/schema_monkey/active_record/base.rb
schema_monkey-0.1.1 lib/schema_monkey/active_record/base.rb
schema_monkey-0.1.0 lib/schema_monkey/active_record/base.rb