Sha256: 747978b49a59c538479c1be5bb87db899aad53baeb78aa53ac65206d9e1cf6fa
Contents?: true
Size: 1.31 KB
Versions: 2
Compression:
Stored size: 1.31 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
active_model_cachers-2.1.8 | lib/active_model_cachers/patches/patch_rails_3.rb |
active_model_cachers-2.1.6 | lib/active_model_cachers/patches/patch_rails_3.rb |