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

added strict param. It's able to you use strict has_role? #349

Merged
merged 4 commits into from Jul 30, 2015

Conversation

sunchess
Copy link
Contributor

class User < ActiveRecord::Base
  rolify strict: true
end

@user = User.first

@user.add_role(:forum, Forum)
@user.add_role(:forum, Forum.first)

@user.has_role?(:forum, Froum) #=> true
@user.has_role?(:forum, Froum.first) #=> true
@user.has_role?(:forum, Froum.last) #=> false

I.e. you get true only on a role that you manually add.

@wldcordeiro
Copy link
Member

This is a good PR but the TravisCI build is currently failing a test for Mongoid. If you can correct this, we'll merge this into the project.

@sunchess
Copy link
Contributor Author

Hm.. sorry but on my local laptop I haven't errors on tests. I really want to.
My PR not have changes gemfile or any config. Why can by the error "Don't know how to build task 'db:create'"?

@sunchess
Copy link
Contributor Author

Hey, tests is fixed

@wldcordeiro
Copy link
Member

Cool, thanks for the PR. Merging. :)

wldcordeiro added a commit that referenced this pull request Jul 30, 2015
added strict param.  It's able to you use strict has_role?
@wldcordeiro wldcordeiro merged commit 989f566 into RolifyCommunity:master Jul 30, 2015
@sunchess
Copy link
Contributor Author

Thank you guys. :)

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 this pull request may close these issues.

None yet

2 participants