-
Notifications
You must be signed in to change notification settings - Fork 783
While we wait for 1.6.11... #989
base: master
Are you sure you want to change the base?
Conversation
@conditions.empty? calls ActiveRecord::Relation#empty? when a scoped condition is provided. ActiveRecord::Relation#empty? will query the database while CanCan only needs to check if conditions are set on the rule.
There are two issues with the current way cancan handles associations: 1) Records are returned multiple times in some circumstances 2) Several defined abilities prevent some records to show up under certain circumstances This commit includes tests for both cases. It fixes both problems by changing `joins` to `includes` for the AR adapters. This could have performance implications, since `includes` will also select all columns in the associated records. We tried various ways of achieving the same thing using Arel directly, but were unable to make this work due to lack of support for outer joins in Rails 3.1. This closes issues ryanb#724, ryanb#566 and ryanb#613
Support for strong_parameters
I've already been asked to keep 1.8.7, so i'll submit a patch in a few to keep it going. |
👍 |
👍 , this really needed to be done! |
Yeah, this is awesome. Thanks. |
👍 |
Thanks guys... this will be a living pull request, i'll keep adding other PRs as needed. |
Great piece of work. Thanks! |
@kuraga Afaik he is still alive, at least when i read this thread yesterday, since i had some rails 4 cancan issues.I did some research and he does login to his stackoverflow account sometimes and even comments ( http://stackoverflow.com/users/148722/ryanb ) and he made changed a gist 18 days ago ( https://gist.github.com/ryanb/4172391 ). Is there anyone that can confirm he/she send him an email at all? or is everyone waiting for somebody else to do that. |
I exchanged emails with @nashby who is a collaborator on CanCan. His only contact with Ryan was through [email protected]. I tried sending an email to Ryan at that address and also sent him a tweet https://twitter.com/wckoehler/status/432529759797387264. |
@bryanrite Maintainance work on CanCan would surely be a good thing for the community. Although i've started switching my project to Authority gem, It's still a blocker on many people's upgrade path to rails 4 who really enjoy this tool and doesn't want to replace it. Is there a known list of hackers except you that would be willing to contribute some time on it ? |
@elthariel @bryanrite I don't think we're going to hear from @ryanb. It seems like he wants to keep a low profile and we should respect that. I think it's time to move forward with a fork. I'll will help out as a core contributor, reviewing issues and pull requests and updating documentation. Do you think there's a chance rubygems.org will allow us to continue publishing under the cancan name until @ryanb returns? Otherwise any ideas for a new name? |
Count me in, I am using this fork in at least a couple large projects. If we are going with a pun name, we should name the fork “couldcan” :)Luca Pradovera On Feb 19, 2014, at 5:49 PM, Will Koehler [email protected] wrote:
|
I'll help with the fork too, I don't want to learn a new framework :p |
On Wed, Feb 19, 2014 at 6:31 PM, JustinAiken [email protected]:
|
I was just testing out the branch on a couple of my bigger clients stuck on 1.6.9. Everything seems to be good and so far it's a viable drop in replacement for the 1.x line. I'm going to cut a new gem, and start it at version 1.7.0 (following SemVer) so it's a simple and intuitive upgrade path. I am stuck on a name, I want it to be obvious that it's a continuation of Ryan's work, so sticking to a variant of cancan: cancant Thoughts? Bryan RiteSent from my mobile device so I apologize for any errors.
|
If you would like to go with the “continuation” name I would rather not have a negative in it. Luca Pradovera On Feb 19, 2014, at 6:42 PM, Bryan Rite [email protected] wrote:
|
@bryanrite Sounds great. @polysics I was also thinking "cancancan". Simple extension of the name with no negatives. |
What about canable? :) |
Thats 3 for I'll cut it ASAP. |
OpenSource at work, my favorite web show On Wed, Feb 19, 2014 at 6:58 PM, Bryan Rite [email protected]:
|
High-fiving you at next parisRB too ;) |
Alright! This branch as it is now has been released as https://rubygems.org/gems/cancancan Please let me know if anyone has any issues with it. It should just drop in, with no code changes. I'm going to keep this issue open, so people can see we've moved on, but please start posting any issues etc. in the new repo: |
Awesome! Thanks @bryanrite. I'll switch my apps over to cancancan and make sure everything still works. I was using your branch before so it should go smoothly. Please reach out to me and let me know what I can do to help as issues come up. |
Good to see things moving for cancan! @pokonski I'm also a lover of accessible_by and scopes that cancan provides. |
@gamov I'm focusing on the 1.x branch for the short term, making sure it is up to date and compatible going forward. I'd also like to spend a bit more time on the test suite and refactoring the code base a little to clean it up. Then I was going to take a look at the 2.x branch. I never used it since it was never actually released and I need to understand what improvements and refinements Ryan was attempting and how, before I feel comfortable moving forward with it. Pull requests are welcome anytime if there is anyone knowledgable about the 2.x branch. |
@gamov just as an update. I realized thanks to comments in this thread that people still want features like AR integration. So I'm working on scopes and accessible_by? for my AccessGranted gem to match the functionality of CanCan. Stay tuned :) |
@bryanrite Thanks for spearheading this reboot. Onward and upward! Quick question: Once the new fork gains traction are you planning on giving merge privileges to additional contributors so that we can help you avoid burn out as well? Excited for the momentum! |
@pokonski Do you have an estimated timeline or goal date on when you would like to have AR Integration added to AccessGranted? |
@codyolsen Absolutely, I was gonna setup an open source organization on GitHub and transfer cancancan into it with other maintainers if it catches on and there is some interest. |
@bryanrite that sounds great! I just added an issue detailing the transition and linking to the new repository. Hopefully that will catch peoples eye and help drive traffic towards the new repo. |
@codyolsen this is what I'm working right now @ https://github.com/pokonski/access-granted-rails |
@bryanrite I dropped cancancan into two apps that were previously using cancan. The transition has been seamless. All specs pass and it's been live in production now for a few days. |
😄 |
Great news ! Good job :D On Tue, Feb 25, 2014 at 8:01 PM, Bryan Rite [email protected]:
|
Just checking here to see if CanCan is still a solution anymore and am happy to see you moving this Bryan. I don't know you, but I'll support your effort and try to use your work and one day maybe help. Appreciate it. |
@bryanrite I use cc2 in production for a very long time already. I like it much better than 1.x. The only part that I find unfinished (thus unusable) is regarding the resource attributes authorisation. It's not flexible enough as it is (see #513). I'm keen to test and feedback any work on this branch. PS: Because of some dependencies, I'm stuck on Rails 3.0.20 for now |
I've taken a number of the pull requests that address rails 4 issues, but also just general query bugs and rolled them up into single PR... the idea being if people want to use a more up to date version of CanCan.
In a nutshell:
.ruby-version
instead of.rvmrc
This PR combines:
#726
#864
#871
#906
#935
#966
#971
#974
#977
#980
#988
Thank you to all the other contributors!