Sha256: 1e5d9efa07f483b7d5e2f290caf6dd79f59a1fb1852eca26ca789b512fd5136b

Contents?: true

Size: 551 Bytes

Versions: 4

Compression:

Stored size: 551 Bytes

Contents

module TemporalTables
  # This is required for eager_load to work in Rails 5.2.x
  module AbstractReflectionExtensions
    def build_join_constraint(table, foreign_table)
      constraint = super
      if at_value = Thread.current[:at_time]
        constraint = constraint.and(klass.build_temporal_constraint(at_value))
      end
      constraint
    end
  end
end

case Rails::VERSION::MAJOR
when 5
  case Rails::VERSION::MINOR
  when 2
    ActiveRecord::Reflection::AbstractReflection.prepend TemporalTables::AbstractReflectionExtensions
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
temporal_tables-0.8.1 lib/temporal_tables/reflection_extensions.rb
temporal_tables-0.8.0 lib/temporal_tables/reflection_extensions.rb
temporal_tables-0.7.1 lib/temporal_tables/reflection_extensions.rb
temporal_tables-0.7.0 lib/temporal_tables/reflection_extensions.rb