diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-06-10 16:36:05 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-06-10 16:36:05 -0300 |
commit | 8c3b8323f57d366fc308e773b286a1847552b0a3 (patch) | |
tree | a558bbfe9b50c5fcfacfe62c7a45db60f17a1ab9 /activerecord/lib/active_record/associations | |
parent | 103b282130dd340143654801430aed787da4c9c6 (diff) | |
download | rails-8c3b8323f57d366fc308e773b286a1847552b0a3.tar.gz rails-8c3b8323f57d366fc308e773b286a1847552b0a3.tar.bz2 rails-8c3b8323f57d366fc308e773b286a1847552b0a3.zip |
Use ARel in SQL generation through associations
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/has_many_through_association.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb index e8dbae9011..51fb75e1f5 100644 --- a/activerecord/lib/active_record/associations/has_many_through_association.rb +++ b/activerecord/lib/active_record/associations/has_many_through_association.rb @@ -32,7 +32,7 @@ module ActiveRecord return @target.size if loaded? return count end - + protected def target_reflection_has_associated_record? if @reflection.through_reflection.macro == :belongs_to && @owner[@reflection.through_reflection.primary_key_name].blank? @@ -48,7 +48,7 @@ module ActiveRecord options[:joins] = construct_joins(options[:joins]) options[:include] = @reflection.source_reflection.options[:include] if options[:include].nil? end - + def insert_record(record, force = true, validate = true) if record.new_record? if force @@ -131,7 +131,7 @@ module ActiveRecord end def construct_from - @reflection.quoted_table_name + @reflection.table_name end def construct_select(custom_select = nil) @@ -239,7 +239,7 @@ module ActiveRecord interpolate_sql(sanitize_sql(conditions)) end end - + def build_sti_condition @reflection.through_reflection.klass.send(:type_condition) end |