Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/inequal_opportunity.rb
Class Method Summary collapse
- .attribute_condition(quoted_column_name, argument) ⇒ Object
- .attribute_condition_orig ⇒ Object
- .expand_range_bind_variables(bind_vars) ⇒ Object
- .expand_range_bind_variables_orig ⇒ Object
Class Method Details
.attribute_condition(quoted_column_name, argument) ⇒ Object
119 120 121 122 123 124 125 126 |
# File 'lib/inequal_opportunity.rb', line 119 def attribute_condition(quoted_column_name, argument) if argument.is_a? ActiveRecord::Inequality::Base question = argument.value.is_a?(Array) ? '(?)' : '?' "#{quoted_column_name} #{argument.operator} #{question}" else attribute_condition_orig(quoted_column_name, argument) end end |
.attribute_condition_orig ⇒ Object
118 |
# File 'lib/inequal_opportunity.rb', line 118 alias attribute_condition_orig attribute_condition |
.expand_range_bind_variables(bind_vars) ⇒ Object
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/inequal_opportunity.rb', line 129 def (bind_vars) = [] bind_vars.each do |var| next if var.is_a?(Hash) if var.is_a?(Range) << var.first << var.last elsif var.is_a?(ActiveRecord::Inequality::Base) << var.value else << var end end end |
.expand_range_bind_variables_orig ⇒ Object
128 |
# File 'lib/inequal_opportunity.rb', line 128 alias |