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

Fix Rule#inspect when rule is created through a SQL array #590

Merged
merged 5 commits into from
Aug 23, 2019

Conversation

frostblooded
Copy link
Contributor

Fixes #589

@frostblooded
Copy link
Contributor Author

frostblooded commented May 15, 2019

I am unsure if this spec is the best one for the case. Ideas are welcome.

@coorasse
Copy link
Member

Hi @frostblooded , thanks for your PR. 👏

", #{@conditions.inspect}"
end

if with_scope?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frostblooded I guess you have pushed this file by mistake.

Copy link
Contributor Author

@frostblooded frostblooded Jul 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. This is the actual fix of the bug. The way it was previously written, when there was an SQL array condition, the if/elsif wouldn't enter into either of the two blocks and it would "return" nil, which would make the code attempt to do a "repr += nil" and would throw an error.

@coorasse coorasse merged commit ad455b7 into CanCanCommunity:develop Aug 23, 2019
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.

Rule's inspect method fails when the rule is created through a SQL array
3 participants