Sha256: 30c98d04c7522e0ed17fb75a85c97359f80093235f87792ef022739bc010ed2b

Contents?: true

Size: 654 Bytes

Versions: 4

Compression:

Stored size: 654 Bytes

Contents

module ChronoModel
  module Patches

    # This class is a dummy relation whose scope is only to pass around the
    # as_of_time parameters across ActiveRecord call chains.
    #
    # With AR 5.2 a simple relation can be used, as the only required argument
    # is the model. 5.0 and 5.1 require more arguments, that are passed here.
    #
    class AsOfTimeRelation < ActiveRecord::Relation
      if ActiveRecord::VERSION::STRING.to_f < 5.2
        def initialize(klass, table: klass.arel_table, predicate_builder: klass.predicate_builder, values: {})
          super(klass, table, predicate_builder, values)
        end
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chrono_model-1.2.2 lib/chrono_model/patches/as_of_time_relation.rb
chrono_model-1.2.1 lib/chrono_model/patches/as_of_time_relation.rb
chrono_model-1.2.0 lib/chrono_model/patches/as_of_time_relation.rb
chrono_model-1.1.0 lib/chrono_model/patches/as_of_time_relation.rb