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

Rule's inspect method fails when the rule is created through a SQL array #589

Closed
frostblooded opened this issue May 15, 2019 · 1 comment · Fixed by #590
Closed

Rule's inspect method fails when the rule is created through a SQL array #589

frostblooded opened this issue May 15, 2019 · 1 comment · Fixed by #590
Assignees
Labels

Comments

@frostblooded
Copy link
Contributor

Steps to reproduce

Define ability with a SQL array and call #inspect.

Example

CanCan::Rule.new(true, :read, Watermelon, ['visible=?', true], {}, {}).inspect

Expected behavior

The method displays the rule in a string format.

Actual behavior

There is an error:

 TypeError:
       no implicit conversion of nil into String
     # ./lib/cancan/rule.rb:37:in `+'
     # ./lib/cancan/rule.rb:37:in `inspect'
     ...

System configuration

Rails version:
5.1.7 (not relevant)
Ruby version:
2.4.6 (not relevant)
CanCanCan version
3.0.1

@coorasse
Copy link
Member

fixed in 3.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants