[13sequel] 15perlun commented on issue #1368: > I don't think it makes sense to have a .rubocop.yml file considering that Sequel development doesn't use rubocop.... 02https://git.io/vHCIV
[13sequel] 15iamhabbeboy commented on issue #368: This is great, you are so wonderful. You solve my biggest problem 02https://git.io/vHCCu
I want to create a foreign key constraint which sets the referenced columns explicitly, rather than just assuming the primary key is referenced. This is possible at lest in postgres with the syntax `ADD CONSTRAINT foo FOREIGN_KEY (source_id, source_type) REFERENCES sources (id, type)`, but I can’t figure out how to specify this in Sequel. Do I need to drop down to raw SQL for this?
I have an array of ranges [(8..12), (13..18)] that I wrote a serializer for. However, when tyring to use the serializer, I get: Sequel::Error: can't express 8..12 as a SQL literal. my serializer seems to work fine with a an array. Why not arrays of arrays?
"However, if all members of the array are arrays with two members, then the array is treated like a hash:
perhaps that's it
can I disable that somehow?
instead of a serializer, can I overwrite the getter and setter for just that value?
[13sequel] 15jeremyevans commented on issue #1368: Automated style checkers lead to a focus on how the code looks, as opposed to how it works. Every development tool added is a barrier to contribution. I don't feel the trade off is worth it. 02https://git.io/vHCbo
eydaimon: You have to wrap such arrays in an Sequel::SQL::ValueList so they are not interpreted as condition specifiers, or override Sequel.condition_specifier?
so Model.new :field => Sequel::SQL::ValueList([(8..12), (13..18)]) ?
I don't know how I can override that one.
guess it needed a .new
tried that and still got an error
there's no hook I can use which happens before that stage in the process?
eydaimon: Possibly Dataset#literal_array_append and Dataset#filter_expr
jeremyevans: Am I wrong to assume `eager :some_name, [list_of_associations]` would work in anonymous usage of Model.dataset_module ?
Actually it does, but it seems to be related to my use of #each at the end of the method chain. Hm.
Looks like eager_each is what I need.
Or just calling `all` before `each`. LOL.
yeah, it's a shame that you have to remember that "all" yourself, otherwise it'll break and not throw an error
quite a wart in the API that's otherwise nearing perfection... :)