Re: validation_helpers

2023-10-29 Thread Marcelo
I don't see the *validation_helpers* plugin adding a *before_validation* class method: https://sequel.jeremyevans.net/rdoc-plugins/classes/Sequel/Plugins/ValidationHelpers.html You can see in the docs how this plugin only adds some *validates_** methods, which should be called inside the

Re: Configure extension on preconnect

2021-10-19 Thread Marcelo
the DB instance, after *:preconnect_extensions* are loaded, but before the connections are made. Best, Marcelo On Sunday, October 17, 2021 at 5:24:33 PM UTC+2 Jeremy Evans wrote: > On Sun, Oct 17, 2021 at 4:49 AM Marcelo wrote: > >> Hello all, >> >> I'm adding th

Configure extension on preconnect

2021-10-17 Thread Marcelo
Hello all, I'm adding the :connection_expiration extension to a DB instance, but I need to change its default expiration time with, for example: DB.pool.connection_expiration_timeout = 100 However, this new expiration time is not applied to the initial connection, but rather the default value

Re: odd number of arguments for Hash

2021-08-29 Thread Marcelo Pereira
If you need to, you can call super in your initialize, passing the parameters the way Sequel models expect. Em dom., 29 de ago. de 2021 às 05:24, bee...@gmail.com escreveu: > Sorry...half way through a Saturday evening. I will try with a single > hash thrown, but how do I require such a

Re: Pagination does not work on models

2021-08-23 Thread Marcelo Pereira
To make it work, you need to: - Enable the extension prior to defining the FooModel class - Run the paginate method on the model dataset with FooModel.dataset.paginate(1,2) I'm not sure if there's a reason why the model doesn't proxy the paginate method to its underlying dataset. Best Em dom.,

Re: Using pg_arrays operations in join conditions

2020-04-07 Thread Marcelo Pereira
Aha! Got it. Thank you very much! Best On Tue, 7 Apr 2020, 21:17 Jeremy Evans, wrote: > On Tuesday, April 7, 2020 at 11:11:59 AM UTC-7, Marcelo wrote: >> >> Hello, >> >> I'm trying to produce this query with Sequel, that would then run on >> PostgreSQL:

Using pg_arrays operations in join conditions

2020-04-07 Thread Marcelo
) LIM... How do I achieve any of this without resorting to raw queries? Thanks in advance for any help or pointers, Best Marcelo -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receivin

Re: Should Sequel continue shipping tests in the gem?

2020-01-19 Thread Marcelo Pereira
I would guess most of the time users are not running Sequel tests and, if one wants to run them, it's simple enough to clone the repository - so I would say not shipping the tests sounds like a good idea. No strong opinions on this one, though - having the tests in the gem is, of course, not a

Mysql2::Error: Duplicate entry for '%s' for key '%s' is not handled by UniqueConstraintViolation

2018-11-13 Thread Marcelo Pereira
is not. Is this on purpose? Should the method read `when 1062, 1586; UniqueConstraintViolation` instead? Please let me know if I can go ahead and open a pull request with this change. Best, Marcelo -- You received this message because you are subscribed to the Google Groups "sequel-talk&q

Re: FrozenError when using pg_enum

2018-04-25 Thread Marcelo Pereira
Yes, you are right - this was a fairly obvious oversight on my part. Thanks a lot for the input. Best On Tuesday, April 24, 2018 at 10:38:33 PM UTC+2, Jeremy Evans wrote: > > On Tuesday, April 24, 2018 at 1:21:52 PM UTC-7, Marcelo Pereira wrote: >> >> Hello, >> >

FrozenError when using pg_enum

2018-04-24 Thread Marcelo Pereira
labels' Here is the minimum code that generates this error: Sequel.migration do change do create_enum(:transaction_status, %w[complete pending pending_publisher]) end end I'm still trying to figure out what is going on and will post more information if I find something. Best, Marcelo -

Re: Equivalent to :methods option from ActiveModel::Serializers::JSON

2018-04-18 Thread Marcelo Pereira
My bad, :include does indeed work as well. On Tuesday, April 17, 2018 at 10:06:18 PM UTC+2, Marcelo Pereira wrote: > > I checked the code, and saw that :include doesn't work, but :only does. > Thanks a lot for answering this quickly. > > On Tuesday, April 17, 2018 at 7:26:40 P

Re: Equivalent to :methods option from ActiveModel::Serializers::JSON

2018-04-17 Thread Marcelo Pereira
I checked the code, and saw that :include doesn't work, but :only does. Thanks a lot for answering this quickly. On Tuesday, April 17, 2018 at 7:26:40 PM UTC+2, Jeremy Evans wrote: > > I think you can use the :include option for this, though I'm not sure what > the :methods option does in AMS.

Equivalent to :methods option from ActiveModel::Serializers::JSON

2018-04-17 Thread Marcelo Pereira
Hello, I'm using the JsonSerializer Plugin in Sequel, but I need to add, to the serialized model, a property that comes from a method call (as opposed to from a database column). Is there a way to do this using this plugin, or should I try to create my own plugin for this? Best -- You