Class: ActiveRecord::Associations::HasManyThroughAssociation
- Inherits:
-
AssociationProxy
- Object
- AssociationProxy
- ActiveRecord::Associations::HasManyThroughAssociation
- Defined in:
- lib/eload_select.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#find(*args) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/eload_select.rb', line 18 def find(*args) = Base.send(:extract_options_from_args!, args) conditions = "#{@finder_sql}" if sanitized_conditions = sanitize_sql([:conditions]) conditions << " AND (#{sanitized_conditions})" end [:conditions] = conditions if [:order] && @reflection.[:order] [:order] = "#{[:order]}, #{@reflection.[:order]}" elsif @reflection.[:order] [:order] = @reflection.[:order] end [:from] ||= construct_from [:joins] = construct_joins([:joins]) [:include] = @reflection.source_reflection.[:include] if [:include].nil? [:select]||= @reflection.[:select]||("#{@reflection.table_name}.*" unless [:include]) () # Pass through args exactly as we received them. args << @reflection.klass.find(*args) end |