aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relation/mutation_test.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-02-04 08:02:45 +1030
committerMatthew Draper <matthew@trebex.net>2016-02-04 08:02:45 +1030
commitcdc112e3ea8bd7b5ba787e64f3f8ee3da3e5a64f (patch)
treeaf61cbfd48e5b43dbbc070e7c298a3cf84fc2544 /activerecord/test/cases/relation/mutation_test.rb
parent7710d7f432ca776885a346346ccf0971e80b7a34 (diff)
downloadrails-cdc112e3ea8bd7b5ba787e64f3f8ee3da3e5a64f.tar.gz
rails-cdc112e3ea8bd7b5ba787e64f3f8ee3da3e5a64f.tar.bz2
rails-cdc112e3ea8bd7b5ba787e64f3f8ee3da3e5a64f.zip
Defer Arel attribute lookup to the model class
This still isn't as separated as I'd like, but it at least moves most of the burden of alias mapping in one place.
Diffstat (limited to 'activerecord/test/cases/relation/mutation_test.rb')
-rw-r--r--activerecord/test/cases/relation/mutation_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation/mutation_test.rb b/activerecord/test/cases/relation/mutation_test.rb
index d0f60a84b5..ffb2da7a26 100644
--- a/activerecord/test/cases/relation/mutation_test.rb
+++ b/activerecord/test/cases/relation/mutation_test.rb
@@ -26,6 +26,10 @@ module ActiveRecord
def sanitize_sql_for_order(sql)
sql
end
+
+ def arel_attribute(name, table)
+ table[name]
+ end
end
def relation