diff options
author | Ben Toews <mastahyeti@gmail.com> | 2017-09-26 09:29:24 -0600 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2017-11-09 22:41:33 +1030 |
commit | 5180fe2cd8233169935065efe8762bd5d7b2709c (patch) | |
tree | 73278df63c9938eb19e2ba1b333e07f70be88b0c /activerecord/test/models/company.rb | |
parent | 02a17492a937d4b423590644ad1481b82facd394 (diff) | |
download | rails-5180fe2cd8233169935065efe8762bd5d7b2709c.tar.gz rails-5180fe2cd8233169935065efe8762bd5d7b2709c.tar.bz2 rails-5180fe2cd8233169935065efe8762bd5d7b2709c.zip |
allow table name and direction in string order arg
Diffstat (limited to 'activerecord/test/models/company.rb')
-rw-r--r-- | activerecord/test/models/company.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb index 1a82a9e646..bbc5fc2b2d 100644 --- a/activerecord/test/models/company.rb +++ b/activerecord/test/models/company.rb @@ -50,7 +50,7 @@ class Firm < Company has_many :clients, -> { order "id" }, dependent: :destroy, before_remove: :log_before_remove, after_remove: :log_after_remove has_many :unsorted_clients, class_name: "Client" has_many :unsorted_clients_with_symbol, class_name: :Client - has_many :clients_sorted_desc, -> { order Arel.sql("id DESC") }, class_name: "Client" + has_many :clients_sorted_desc, -> { order "id DESC" }, class_name: "Client" has_many :clients_of_firm, -> { order "id" }, foreign_key: "client_of", class_name: "Client", inverse_of: :firm has_many :clients_ordered_by_name, -> { order "name" }, class_name: "Client" has_many :unvalidated_clients_of_firm, foreign_key: "client_of", class_name: "Client", validate: false |