Sha256: 792fab5dfdf690d773afa9cf4525cebfda6e3c696a52b36e2bc73057b64eb562

Contents?: true

Size: 523 Bytes

Versions: 1

Compression:

Stored size: 523 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

1 entries across 1 versions & 1 rubygems

Version Path
temporal_tables-0.6.10 lib/temporal_tables/reflection_extensions.rb