I realize there is the option
```
class ShoppingCart < Sequel::Model(:shopping_carts)
dataset_module do
def with_campaign_id(campaign_id)
where(krptk89: campaign_id)
end
end
end
```
but I was also hoping for
```
shopping_cart.campaign_id = 5
shopping_cart.save
# Expected: UPDATE shopping_carts SET campaign_id = 5 WHERE ID = 123;
```
Also, there is no such thing as a "campaigns table", so I cannot use
associations in my real world use case.
Leo Arnold schrieb am Freitag, 23. Juli 2021 um 13:33:00 UTC+2:
> Hi there,
>
> I am using Sequel to access database tables with cryptic column names and
> for the sake of my own sanity I would like to do something like
>
> ```
> class ShoppingCart < Sequel::Model(:shopping_carts)
> column :krptk89, as: :campaign_id
> end
>
> ShoppingCart.where(campaign_id: 3).sql
> # Expected: SELECT * FROM shopping_carts WHERE krptk89 = 3;
> ```
>
> Does Sequel offer something like that?
>
> Thanks
>
> Leo
>
--
*Whitebox Services GmbH*
Ingeborg-Krummer-Schroth-Str.
30 | 79106 Freiburg
|
Deutschland
T: +49 761 76 99 22 40
www.whitebox.eu
<http://www.whitebox.eu> <http://www.whitebox.eu>
Geschäftsführung: Salome
Preiswerk, Dr. Birte Rothkopf
Handelsregister:
HRB 717773, Amtsgericht
Freiburg i. Br.
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/5f198d7f-8c3f-4103-8703-7ea936c45994n%40googlegroups.com.