-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Model instance method this
returns dataset without a row_proc
and thus returns a Hash
#2280
Comments
The current behavior is expected. The documentation states: "Returns (naked) dataset that should return only this instance.". This has been true since the method was originally added to Sequel, as far as I know: https://github.com/jeremyevans/sequel/blob/1.0/sequel_model/lib/sequel_model/record.rb#L145 |
So an instance means a Hash? Seems like maybe confusing documentation? |
The |
Yes, that is definitely better. It makes sense that it's intuitive language for you but for someone less familiar with the library the term "naked" doesn't really communicate what it does. However, if you'd like to rely on "naked dataset" to inform the user about the behavior, I would simply say "Returns a naked dataset for this instance." "A naked dataset that should return only this instance" makes me think that the naked dataset would return an instance. Thanks for the fix 👍 |
Complete Description of Issue
Given some model
Thing
, I would expect thethis
method of an instancething
ofThing
to return a dataset that would produce aThing
. But in my use it does not, it returns a Hash of the key/value pairs.I investigated, and it appears that the dataset produced by the
this
method does not have arow_proc
set in itsopts
.Setting the
row_proc
toThing
will cause the dataset to return aThing
.This is Sequel
v5.89.0
Simplest Possible Self-Contained Example Showing the Bug
Is this a bug? It's not what I would expect.
Full Backtrace of Exception (if any)
No response
SQL Log (if any)
No response
Ruby Version
3.0.6
Sequel Version
5.89.0
The text was updated successfully, but these errors were encountered: