Module: ActiveRecord::Extensions::FinderOptions::ConstructSqlCompatibility::ClassMethods

Defined in:
lib/ar-extensions/finder_options.rb

Instance Method Summary collapse

Instance Method Details

#add_from!(sql, options, scope = :auto) ⇒ Object

pre Rails 2.0.0 the order of the scope and options was different



206
207
208
# File 'lib/ar-extensions/finder_options.rb', line 206

def add_from!(sql, options, scope = :auto)#:nodoc:
  sql << " FROM #{(scope && scope[:from]) || options[:from] || table_name} "
end

#add_joins_with_compatibility!(sql, options, scope = :auto) ⇒ Object

:nodoc:



195
196
197
198
# File 'lib/ar-extensions/finder_options.rb', line 195

def add_joins_with_compatibility!(sql, options, scope = :auto)#:nodoc:
  join_param = options.is_a?(Hash) ? options : { :joins => options }
  add_joins_without_compatibility!(sql, join_param, scope)
end

#add_select_column_sql!(sql, options, scope = :auto) ⇒ Object

:nodoc:



210
211
212
# File 'lib/ar-extensions/finder_options.rb', line 210

def add_select_column_sql!(sql, options, scope = :auto)#:nodoc:
  sql << "#{options[:override_select] || (scope && scope[:select]) || options[:select] || '*'}"
end

#quoted_table_nameObject

aliasing threw errors



201
202
203
# File 'lib/ar-extensions/finder_options.rb', line 201

def quoted_table_name#:nodoc:
  self.table_name
end