Sha256: d940691c79620807c69eeb9102350444449a45ddcc067628f891fbcfa27bd07a

Contents?: true

Size: 1.26 KB

Versions: 4

Compression:

Stored size: 1.26 KB

Contents

# frozen_string_literal: true
module ActiveModelCachers
  module ActiveRecord
    module Extension
      # define #find_by for Rails 3
      def find_by(*args)
        where(*args).order('').first
      end
    end
  end
end

module ActiveRecord
  module Transactions
    if not method_defined?(:transaction_include_any_action?)
      def transaction_include_any_action?(fire_on)
        fire_on.any?{|s| transaction_include_action?(s) }
      end
    end
  end
end

module ActiveRecord
  module Associations
    # = Active Record Associations
    #
    # This is the root class of all associations ('+ Foo' signifies an included module Foo):
    #
    #   Association
    #     SingularAssociation
    #       HasOneAssociation
    #         HasOneThroughAssociation + ThroughAssociation
    #       BelongsToAssociation
    #         BelongsToPolymorphicAssociation
    #     CollectionAssociation
    #       HasAndBelongsToManyAssociation
    #       HasManyAssociation
    #         HasManyThroughAssociation + ThroughAssociation
    class Association #:nodoc:
      alias_method :scope, :scoped
    end
  end
end

class ActiveModelCachers::ColumnValueCache
  def pluck_columns(object, relation, columns)
    object.connection.select_all(relation.select(columns)).map(&:values)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
active_model_cachers-2.1.7 lib/active_model_cachers/patches/patch_rails_3.rb
active_model_cachers-2.1.5 lib/active_model_cachers/patches/patch_rails_3.rb
active_model_cachers-2.1.4 lib/active_model_cachers/active_record/patch_rails_3.rb
active_model_cachers-2.1.3 lib/active_model_cachers/active_record/patch_rails_3.rb