Sha256: aa229724451d6fc4f89eaac9a8ecddeb778ee2bc149b6e8426dafa1b2d807c23

Contents?: true

Size: 370 Bytes

Versions: 5

Compression:

Stored size: 370 Bytes

Contents

module TemporalTables
	module NamedExtensionsWithHistory
		def scope(name, body, &block)
			if history
				history_body = -> { history.instance_exec &body }
				history.scope_without_history name, history_body, &block
			end
			super name, body, &block
		end
	end
end

ActiveRecord::Scoping::Named::ClassMethods.send :prepend, TemporalTables::NamedExtensionsWithHistory

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
temporal_tables-0.6.6 lib/temporal_tables/scope_extensions.rb
temporal_tables-0.6.4 lib/temporal_tables/scope_extensions.rb
temporal_tables-0.6.3 lib/temporal_tables/scope_extensions.rb
temporal_tables-0.6.2 lib/temporal_tables/scope_extensions.rb
temporal_tables-0.6.1 lib/temporal_tables/scope_extensions.rb