diff options
Diffstat (limited to 'lib/arel/engines/sql/relations/relation.rb')
-rw-r--r-- | lib/arel/engines/sql/relations/relation.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/arel/engines/sql/relations/relation.rb b/lib/arel/engines/sql/relations/relation.rb index 448cf7951d..8b71aa8c04 100644 --- a/lib/arel/engines/sql/relations/relation.rb +++ b/lib/arel/engines/sql/relations/relation.rb @@ -16,7 +16,8 @@ module Arel "FROM #{from_clauses}", (joins(self) unless joins(self).blank? ), ("WHERE #{where_clauses.join("\n\tAND ")}" unless wheres.blank? ), - ("GROUP BY #{group_clauses.join(', ')}" unless groupings.blank? ) + ("GROUP BY #{group_clauses.join(', ')}" unless groupings.blank? ), + ("#{locked}" unless locked.blank? ) build_query \ "SELECT * FROM (#{query}) AS id_list", @@ -33,7 +34,8 @@ module Arel ("GROUP BY #{group_clauses.join(', ')}" unless groupings.blank? ), ("ORDER BY #{order_clauses.join(', ')}" unless orders.blank? ), ("LIMIT #{taken}" unless taken.blank? ), - ("OFFSET #{skipped}" unless skipped.blank? ) + ("OFFSET #{skipped}" unless skipped.blank? ), + ("#{locked}" unless locked.blank? ) end end |