Module: Fancygrid::Orm::SqlGenerator
- Included in:
- ActiveRecord
- Defined in:
- lib/fancygrid/orm/sql_generator.rb
Overview
:nodoc:
Constant Summary collapse
- OPERATOR_NAMES =
[ :equal, :not_equal, :less, :less_equal, :greater, :greater_equal, :starts_with, :ends_with, :like, :insensitive_starts_with, :insensitive_ends_with, :insensitive_like, :is_null, :is_not_null, :is_true, :is_not_true, :is_false, :is_not_false, :in, :not_in ]
Instance Attribute Summary collapse
-
#query_options ⇒ Object
Returns the value of attribute query_options.
Instance Method Summary collapse
Instance Attribute Details
#query_options ⇒ Object
Returns the value of attribute query_options.
11 12 13 |
# File 'lib/fancygrid/orm/sql_generator.rb', line 11 def end |
Instance Method Details
#execute(resource_class) ⇒ Object
35 36 37 |
# File 'lib/fancygrid/orm/sql_generator.rb', line 35 def execute resource_class raise "called execute on abstract class" end |
#initialize(options) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/fancygrid/orm/sql_generator.rb', line 13 def initialize() self. = {} if grid = [:grid] self.[:order] = grid.view_state.sql_order end if select = [:select] self.[:select] = select end if pagination = [:pagination] self.[:limit] = pagination[:per_page].to_i self.[:offset] = (pagination[:page].to_i - 1) * pagination[:per_page].to_i end if conditions = self.build_conditions([:operator], [:conditions]) self.[:conditions] = conditions end end |