On Wednesday, August 29, 2012 11:26:40 AM UTC-7, Iain Barnett wrote: > > I've been trying to use the :select option on an association to add in > some fields from a join table, but it was giving me an error with the > :select (not without). > > The example from the docs: > > User.many_to_many :films, > :left_key => :user_id, > :right_key => :film_id, > :join_table => :users_rel_films, > :select => [ Sequel.expr(:films).*, > :users_rel_films__no_of_views, > :users_rel_films__demand], > :class => :"App::Film" > > > Error: ArgumentError: wrong number of arguments (0 for 1) > > So I tried a few things in the console: > > Sequel.expr(:films).* # according to the docs this should return > "films".* > > > ArgumentError: wrong number of arguments (0 for 1) > > In case it's something to do with that table, I tried: > > Sequel.expr(:schema_info).* > > > ArgumentError: wrong number of arguments (0 for 1) > > but this works: > > Sequel.expr(:schema_info).* 2 > > > => #<Sequel::SQL::NumericExpression @op=>:, > args=>[#<Sequel::SQL::Wrapper @value=>:schema_info, 2] > > This is ok too: > > Sequel.expr(:schema_info) > > > => #<Sequel::SQL::Wrapper @value=>:schema_info > > I've tried a few other things but they all give either the same error or > syntax errors. > > The sequel version is 3.36.1 > > The documentation reflects the latest release of Sequel. Support for Sequel.expr(:table).* was added in Sequel 3.38.0.
Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/sequel-talk/-/bOvOw045wbMJ. 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.
