You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An ActiveRecord model with: default_scope { select([:id, :anint, :astring]]) } brings rails_admin to generate a query like: SELECT COUNT(id, anint, astring) FROM "scope_selects") in "controller":"rails_admin/main","action":"dashboard
This leads to: Mysql2::Error - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' id, anint, astring) FROM 'scope_selects'' or ActiveRecord::StatementInvalid (SQLite3::SQLException: wrong number of arguments to function COUNT(): SELECT COUNT(id, anint, astring) FROM "scope_selects")
when loading the dashboard, because COUNT() does not support multiple keys.
Edit:
The broken statement is actually build by AR, but it seems to be the intendent behavior (insert generic rant here) and must be fixed in the application: rails/rails#15514
The text was updated successfully, but these errors were encountered:
An ActiveRecord model with:
default_scope { select([:id, :anint, :astring]]) }
brings rails_admin to generate a query like:SELECT COUNT(id, anint, astring) FROM "scope_selects")
in"controller":"rails_admin/main","action":"dashboard
This leads to:
Mysql2::Error - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' id, anint, astring) FROM 'scope_selects''
orActiveRecord::StatementInvalid (SQLite3::SQLException: wrong number of arguments to function COUNT(): SELECT COUNT(id, anint, astring) FROM "scope_selects")
when loading the dashboard, because
COUNT()
does not support multiple keys.Env:
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
Rails 4.2.4
Gemfile.lock: https://gist.github.com/martin-schmidt/647b982bfa782eeb0e1c
Stacktrace: https://gist.github.com/martin-schmidt/a5fef39cfbb5773a4917
Example: https://github.com/martin-schmidt/rails_admin/commit/354889451900
Failing tests: https://travis-ci.org/martin-schmidt/rails_admin/builds/88326027
Edit:
The broken statement is actually build by AR, but it seems to be the intendent behavior (insert generic rant here) and must be fixed in the application:
rails/rails#15514
The text was updated successfully, but these errors were encountered: