Operand should contain 1 column(s)
-
James Herdman
Slight update.
Part of the SQL involved is clearly from the Acts_As_Paranoid plugin. If you rip this out you get the same error with SQL like:
SELECT count(*) AS count_all FROM places WHERE ( SELECT * FROM places )Same error though. How is WP counting? I can't quite track it down in the code.
-
James Herdman
I'm still working on hunting down this bug, but I thought I'd post some progress. Attached is a modified copy of the will_paginate plugin that uses an STI relationship:
User -> Admin
User -> Developer
If you run the tests for the attached you'll see two errors: ignore the first one for the join tests. The second error is exactly what I'm getting -- but I use MySQL in my development environment instead of SQLite3.
Any ideas?
-
Chris Wanstrath
- State changed from new to open
- Assigned user changed from Chris Wanstrath to Mislav
-
Chris Wanstrath
- State changed from open to invalid
(from [277]) Will Paginate: User-Admin-Developer now in STI. [#43 state:invalid]
-
Mislav
James,
I closed this because this is not a valid use case.
class Admin < User has_many :places, :finder_sql => 'SELECT * FROM places' do def find(*args) Place.find(*args) end end endFirst of all, this "association" doesn't make any sense. Second, you're using the :finder_sql option, which means WP will probably be unable to count by itself. You'll have to pass the count in the :total_entries option.
While your result SQL is certainly strange, you'll have to do 2 things before reopening this ticket: 1) use edge Rails and 2) provide a valid use case I can test with.
I've modified existing tests to use STI for User-Developer-Amin. This will make it easier for you to send me a patch with a valid failing test case. Thanks
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.