diff options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index a098c02829..599d04e593 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -280,8 +280,11 @@ module ActiveRecord sql << " NOT NULL" if options[:null] == false end - # SELECT DISTINCT clause for a given set of columns. PostgreSQL overrides this for custom DISTINCT syntax. - def distinct(columns, *order_columns) + # SELECT DISTINCT clause for a given set of columns and a given ORDER BY clause. + # Both PostgreSQL and Oracle overrides this for custom DISTINCT syntax. + # + # distinct("posts.id", "posts.created_at desc") + def distinct(columns, order_by) "DISTINCT #{columns}" end end |