Method: AdminAssistant::Index::RecordFinder#add_base_condition_sqls

Defined in:
lib/admin_assistant/index.rb

#add_base_condition_sqlsObject



81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/admin_assistant/index.rb', line 81

def add_base_condition_sqls
  if @index.controller_methods[:conditions_for_index]
    sql = @index.controller_methods[:conditions_for_index].call
    @ar_query.condition_sqls << sql if sql
  elsif conditions_from_settings
    if conditions_from_settings.respond_to?(:call)
      conditions_sql = conditions_from_settings.call @index.url_params
    else
      conditions_sql = conditions_from_settings
    end
    @ar_query.condition_sqls << conditions_sql if conditions_sql
  end
end