Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency between has_any_role? and with_any_role #363

Open
Animeye opened this issue Oct 15, 2015 · 1 comment · May be fixed by #365
Open

Inconsistency between has_any_role? and with_any_role #363

Animeye opened this issue Oct 15, 2015 · 1 comment · May be fixed by #365

Comments

@Animeye
Copy link

Animeye commented Oct 15, 2015

Should these two be behaving (conceptually) differently when given no arguments? User.with_any_role() won't match any users, but some_user.has_any_role?() will return true

@EppO
Copy link
Member

EppO commented Oct 16, 2015

True that. User.with_any_role() with no args should return all users with at least one role. some_user.has_any_role?() current behaviour looks correct.

EppO added a commit that referenced this issue Oct 16, 2015
User.with_any_role with no args should return all User instances having at least one role.
fix #363
@EppO EppO linked a pull request Oct 16, 2015 that will close this issue
EppO added a commit that referenced this issue Oct 16, 2015
User.with_any_role with no args should return all User instances having at least one role.
fix #363

For the generator specs to pass, I needed to add this: ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
Otherwise, generators specs are failing because of `ActiveRecord::ConnectionNotEstablished: No connection pool for ActiveRecord::Base` error.

I had to require explicitly active_view and active_controller gems for mongoid adapter to make generators specs pass for mongoid.
I changed also mongoid.yml to use clients instead of sessions
I tried to stop logging mongoid queries as it floods travis-ci but travis-ci displays logs from mongodb service directly and reaches 4MB logs limit. I don't know how to stop it
EppO added a commit that referenced this issue Oct 23, 2015
User.with_any_role with no args should return all User instances having at least one role.
fix #363

For the generator specs to pass, I needed to add this: ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
Otherwise, generators specs are failing because of `ActiveRecord::ConnectionNotEstablished: No connection pool for ActiveRecord::Base` error.

I had to require explicitly active_view and active_controller gems for mongoid adapter to make generators specs pass for mongoid.
I changed also mongoid.yml to use clients instead of sessions and disabled mongod logging that were flooding travis-ci outputs and reached the log size limit (4MB)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants