New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #11454 . We should define the return type of select_all method clearly. #11461
Conversation
@@ -18,8 +18,7 @@ def to_sql(arel, binds = []) | |||
end | |||
end | |||
|
|||
# Returns an array of record hashes with the column names as keys and | |||
# column values as values. | |||
# Returns an ActiveRecord::Result instance with columns and rows methods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's enough to say: "Returns an ActiveRecord::Result instance". However we should improve the documentation of ActiveRecord::Result
.
Can you squash the commits and maybe also improve the docs on |
hi @senny. I also try to add some usage comments. Please some advise for me :) |
# result = ActiveRecord::Base.connection.exec_query('SELECT id, title, body FROM posts') | ||
# result # => #<ActiveRecord::Result:0xdeadbeef> | ||
# | ||
# # Gets column name array. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would reword this to: "Get the column names of the result:"
@kennyj looks great! 💛 |
thank you for your advises, @senny |
This looks good. Can you add |
okay. I've already updated. |
Fixes #11454 . We should define the return type of select_all method clearly.
Fixes #11454.
Now
select_all
andselect
methods return an ActiveRecord::Result instance.I think we should define the return type of select_all method clearly, and fix related comments.