brendon / acts_as_list

An ActiveRecord plugin for managing lists.
http://brendon.github.io/acts_as_list/
MIT License
2.04k stars 355 forks source link

Unscope select. #304

Closed Artur-Sulej closed 6 years ago

Artur-Sulej commented 6 years ago

Using default_scope with select (e.g. default_scope { select(column_names - ['huge_data_column']) }) along with acts_as_list causes error: ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR: function count(uuid, …, timestamp without time zone) does not exist.

I fixed this by adding unscoping select in query used for count.

brendon commented 6 years ago

I have a feeling that someone else brought this up previously though I can't find the issue. Would you be able to see if you can track it down? Actually I found it: https://github.com/swanandp/acts_as_list/pull/283

Can you check through that one and report back on the best solution? Looks like we settled on unscoping :select there too.

brendon commented 6 years ago

@hot-cheese, I'm closing this in favour of #283 since he wrote a test also. Come on over there to discuss further if you want :)