On Mar 16, 12:33 pm, None <[email protected]> wrote: > I have something like this: > > ds = MyModel.eager_graph(:foo, :bar).filter(:my_model_id => 510620) > > which results in: > > Sequel::DatabaseError: Mysql::Error Column 'my_model_id' in where > clause is ambiguous > > It looks like the :bar association is the cause, since it's a > many_to_many through a join table that has a my_model_id column. How > do I get around this?
ds = MyModel.eager_graph(:foo, :bar).filter(:foo__my_model_id => 510620) You need to qualify the column with the table name. You can do it like the above by putting two underscores between the table name and the column name inside the symbol or use the qualify method :my_model_id.qualify(:foo). 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 -~----------~----~----~----~------~----~------~--~---
