On Oct 19, 3:36 pm, Shawn <[email protected]> wrote:
> It would be really nice to have the option to provide alternate names
> (aliases) for Sequel model associations, as seen here:
>
> class Supplier < Sequel::Model
> one_to_many :supplier_products, :aliases => [:products]
> end
Why wouldn't you just do:
class Supplier < Sequel::Model
one_to_many :products, :class=>:SupplierProduct
end
> The above code would make my_supplier.products an alias to
> my_supplier.supplier_products. It would also set up similar aliases
> for all of the other association methods, e.g. products_dataset,
> add_product, etc.
>
> I know it's possible to just name the association 'products' with a
> class_name of 'supplier_products', but it is sometimes helpful to have
> aliases, and the above syntax would make defining these aliases much
> simpler and more scalable.
Well, apparently you know you can do the above. I'm sure using is
sometimes helpful for you, but I don't think this is a feature that
would benefit most Sequel users. I recommend that you write a plugin
that does this if you desire this behavior.
Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---