aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRafael Mendonça França <rafael.franca@plataformatec.com.br>2012-07-27 19:36:44 -0300
committerRafael Mendonça França <rafael.franca@plataformatec.com.br>2012-07-27 19:36:44 -0300
commit74262e654b56e8b95e8e1af46d73e3f89a8df93a (patch)
tree68c8ac8c04c8cc9273bb2d64d7d40adc749dff86 /activerecord
parent46b24c958a89b75e48ee42be0520a15b7c4484a9 (diff)
downloadrails-74262e654b56e8b95e8e1af46d73e3f89a8df93a.tar.gz
rails-74262e654b56e8b95e8e1af46d73e3f89a8df93a.tar.bz2
rails-74262e654b56e8b95e8e1af46d73e3f89a8df93a.zip
Revert "Removed reference to composed_of."
This reverts commit c34c1916d1d6cd6ba219aa39eb97fa2e77c4c61f. Reason: composed_of was added from now to discuss better
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/sanitization.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/sanitization.rb b/activerecord/lib/active_record/sanitization.rb
index 0dd4070ba4..ca767cc704 100644
--- a/activerecord/lib/active_record/sanitization.rb
+++ b/activerecord/lib/active_record/sanitization.rb
@@ -54,6 +54,9 @@ module ActiveRecord
# # => "`other_records`.`id` = 7"
# { :other_records => { :id => 7 } }
# # => "`other_records`.`id` = 7"
+ # And for value objects on a composed_of relationship:
+ # { :address => Address.new("123 abc st.", "chicago") }
+ # # => "address_street='123 abc st.' and address_city='chicago'"
def sanitize_sql_hash_for_conditions(attrs, default_table_name = self.table_name)
table = Arel::Table.new(table_name).alias(default_table_name)
PredicateBuilder.build_from_hash(arel_engine, attrs, table).map { |b|