Thanks for all the hard work on CanCan and other projects. I have been using CanCan with Mongoid Documents for over a month now. I had a monkeypatch in my app to get the two gems to work together. Recently I decided to try and add Mongoid support into CanCan out of the box.
I've got things functional and added some specs (they all pass), but I'm sure there's lots of room for improvement. Appreciate any feedback you may have. I'll do my best to fix any problems.
Mani (github: bowsersenior)
Add support for Mongoid documents along with basic specs.
Add support for Mongoid::Criteria Symbol extensions (:age.gt => 10) a…
…long with specs.
This looks awesome, thanks! I'll schedule this to be added to the 1.5 release.
Fix accessible_by for Mongoid documents when no ability is defined.
The previous spec that checked for this was not right, since there were no documents in the collection, so every query would return an empty result.
Cool. Just fixed a little bug. I'll continue to make tweaks and improvements as they come to mind.
Fix bug with CanDefinition#tableized_conditions being used with Mongo…
…id documents and add more specs for accesible_by with Mongoid.
Fix bug with Mongoid document where :manage :all caused accessible_by…
… to return nothing and add specs to test for :manage :all.
can't wait to have accessible_by support for mongoid!
can? should only go to db if there are mongoid criteria in the condit…
Easier to just do a simple comparison on the object in memory
than to search the database. Also this allows method calls
and other attributes that might not be found in the database.
Update specs for MongoidAdditions to use rr mocks
tylergannon was kind enough to clean up and streamline the Mongoid support code in my fork.
Add comments clarifying `alias_method` in MongoidAdditions
Remove commented-out line from gemspec
This is pulled in, thanks bowsersenior! It will be in the 1.5 release.