Skip to content

Commit 3f0971d

Browse files
Merge pull request rails#48448 from a5-stable/fix-returning-doc
wrap Arel.sql to avoid error in doc of insert_all, upsert_all
2 parents 0174283 + 6538d65 commit 3f0971d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

activerecord/lib/active_record/persistence.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def insert(attributes, returning: nil, unique_by: nil, record_timestamps: nil)
122122
# clause entirely.
123123
#
124124
# You can also pass an SQL string if you need more control on the return values
125-
# (for example, <tt>returning: "id, name as new_name"</tt>).
125+
# (for example, <tt>returning: Arel.sql("id, name as new_name")</tt>).
126126
#
127127
# [:unique_by]
128128
# (PostgreSQL and SQLite only) By default rows are considered to be unique
@@ -212,7 +212,7 @@ def insert!(attributes, returning: nil, record_timestamps: nil)
212212
# clause entirely.
213213
#
214214
# You can also pass an SQL string if you need more control on the return values
215-
# (for example, <tt>returning: "id, name as new_name"</tt>).
215+
# (for example, <tt>returning: Arel.sql("id, name as new_name")</tt>).
216216
#
217217
# [:record_timestamps]
218218
# By default, automatic setting of timestamp columns is controlled by
@@ -278,7 +278,7 @@ def upsert(attributes, on_duplicate: :update, returning: nil, unique_by: nil, re
278278
# clause entirely.
279279
#
280280
# You can also pass an SQL string if you need more control on the return values
281-
# (for example, <tt>returning: "id, name as new_name"</tt>).
281+
# (for example, <tt>returning: Arel.sql("id, name as new_name")</tt>).
282282
#
283283
# [:unique_by]
284284
# (PostgreSQL and SQLite only) By default rows are considered to be unique

0 commit comments

Comments
 (0)