Clutch

CanCanCan 3.0 is here! RoR authorization framework got updated

CanCanCan 3.0 is here! RoR authorization framework got updated
Average rating: 0
(0 votes)

Awesome news for Ruby on Rails fans! CanCanCan 3.0 is here! RoR authorization framework got updated and we can’t be silent about it. It has been almost two years since the release of version 2.0, so it will have some new exciting features that we will share with you in this post.

First of all, it is a major version, so be ready for some really important changes:

  • All kind of rules like can :dashboard are not going to be accepted anymore and will raise an exception. They will be rethought in terms of can :action, subjectcan :read, :dashboard.
  • All necessary includespreload or eager_load need to be explicitly written.
  • The uniqueness of the results is guaranteed by using the distinct clause in the final query. Adding a custom select may be necessary in such cases.
  • When merging different Ability files, the aliases are now got merged. This might cause some incompatibility issues.
  • You can now use symbols when defining your rules over enum attributes.
  • CanCanCan 3.0 is able to recognize rules that are not needed and change the last query.
  • Compressing rules means unnecessary JOIN and WHERE conditions will be skipped.

Do you feel that spirit of changes? We do. And we recommend you to check this material to explore all changes in more details.

And speaking of changes, did you check our last Monthly trending Ruby on Rails repositories? There you will explore a great serialization solution, Ruby autoformatter, GitLab CE Mirror, toolkit for file attachments, collaborative knowledge-exchange platform, Object Oriented DOM Tree and many other awesome repositories.

And we have Telegram! Join if you feel you can handle all the amazing information we’re eager to share!

Rate this article, if you like it

Thanks! You’ve rated this material!

Got a project? Let's discuss it!

*By submitting this form you agree with our Privacy Policy.

Mailing & Legal Address

Syndicode Inc. 340 S Lemon Ave #3299, Walnut CA, 91789, USA

Visiting & Headquarters address
Kyiv Sofiivska 1/2a, 01001, Kyiv, Ukraine
Dnipro Hlinky 2, of. 1003, 49000, Dnipro, Ukraine
Email info@syndicode.com
Phone (+1) 9035021111