Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Odd YAML output when passing to select() #23

Open
ashb opened this issue May 24, 2011 · 0 comments
Open

Odd YAML output when passing to select() #23

ashb opened this issue May 24, 2011 · 0 comments

Comments

@ashb
Copy link

ashb commented May 24, 2011

Attempting to use the 'Intelligent hash condition mapping' I was trying to get the following SQL:

SELECT histories.*, count(*), sum(vendor_earnings) FROM `histories`

so I tried the following:

History.select( [ { :histories => '*' }, :count.func( '*' ), :sum.func( :vendor_earnings) ] ).to_sql

But it didn't work. Two things wrong as you can see in what it actually produced:

> History.select( [ {:histories => '*' }, :count.func( '*' ), :sum.func( :vendor_earnings) ] ).debug_sql
 => "SELECT '--- \\n:histories: \\\"*\\\"\\n', count('*'), sum(vendor_earnings) FROM `histories`" 

The two issues are

  1. '*' instead of just *
  2. The odd yaml

Its possible I'm just using MetaWhere for something its not designed for (select vs where) but its tantalisingly close to Just Working.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant