Replies: 1 comment 2 replies
-
|
The behavior is currently expected. It is documented that Sequel::Model will only forward certain methods to the dataset, and It's simple to add We could extend this is to do the same for all Enumerable methods, but this is a double edged sword. I think it results in better behavior in the common case, but in the case where Model.each has been overridden, it changes behavior for the worse. Possibly something to be considered in Sequel 6, with a plugin to revert to the current behavior. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We have some dataset extensions enabled, for example the excellent any_not_empty extension. Excerpt from our application initializer:
From experimenting, it seems that enabling a dataset extension does not make it available when a method is called on a
Sequel::Modeland sent to the associated dataset. This is somewhat surprising and could be a potential footgun. For example:Questions:
Is this behavior by design, or are we missing some configuration? If it is by design, is there a recommended way to make dataset extensions available when calling dataset methods from
Sequel::Model? If this is intended behavior, could it be documented somewhere to prevent confusion? I could not find this documented, but I might very well have missed it.Environment:
Sequel version: 5.97.0
Ruby version: 3.3.7
Database: PostgreSQL
Beta Was this translation helpful? Give feedback.
All reactions