Sha256: 8fc0930336530783810869f4b559a16b414c0ec8b7299ec2411eba28ee5a1af8
Contents?: true
Size: 873 Bytes
Versions: 3
Compression:
Stored size: 873 Bytes
Contents
module HasDynamicColumns module ActiveRecord module Relation def self.included(base) base.class_eval do attr_accessor :where_dynamic_columns_values, :order_dynamic_columns_values # Collect all where clauses def where_dynamic_columns_values @where_dynamic_columns_values || [] end def where_dynamic_columns_values=values raise ImmutableRelation if @loaded @where_dynamic_columns_values ||= [] @where_dynamic_columns_values << values end # Collect all order clauses def order_dynamic_columns_values @order_dynamic_columns_values || [] end def order_dynamic_columns_values=values raise ImmutableRelation if @loaded @order_dynamic_columns_values ||= [] @order_dynamic_columns_values << values end end base.instance_eval do end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems