Sha256: 46a93babb1c85013cfd2effeb265b798a0337ae1085f3e682137614bb9000d40

Contents?: true

Size: 711 Bytes

Versions: 3

Compression:

Stored size: 711 Bytes

Contents

class ActiveRecord::Base
  
  class << self
    
    private
    
    def attribute_condition_with_grouped_scope(*args)
      if ActiveRecord::VERSION::STRING >= '2.3.0'
        quoted_column_name, argument = args
        case argument
          when GroupedScope::SelfGroupping then "#{quoted_column_name} IN (?)"
          else attribute_condition_without_grouped_scope(quoted_column_name,argument)
        end
      else
        argument = args.first
        case argument
          when GroupedScope::SelfGroupping then "IN (?)"
          else attribute_condition_without_grouped_scope(argument)
        end
      end
    end
    alias_method_chain :attribute_condition, :grouped_scope
    
  end
  
end


Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
decisiv-grouped_scope-0.6.0.1 lib/grouped_scope/core_ext.rb
metaskills-grouped_scope-0.6.0 lib/grouped_scope/core_ext.rb
grouped_scope-0.6.1 lib/grouped_scope/core_ext.rb