Allow custom IDs to be specified when calling load_resource
…ame to find members
…ataMapper - closes #373
…isn't found - closes #366
Fixes bug in mongoid_adapter with empty conditions hash
* adds mongoid query that matches every record when rule.conditions.empty? is true
Same limitations apply as with active record * can not be OR'd with other rules for same ability/controller
…/cancan into socialcast-optional-associations
…hrow exceptions if the associated object was not present at the rule match time.
…ss. May fix ryanb/cancan#328 :)
…'t mess up database - closes #304
…lt to :show so we don't check :read action directly - closes #302
This reverts e3eab13 I don't know what was the idea of that, but it turned out REAL bad. `collection` sets the collection instance variable. `resource_base` is used all over CanCan. It's also used inside `load_collection?` which is checked before `load_collection` is called. That means we actually set the collection instance variable through inherited_resources (without any authorization whatsoever) before trying to load it through CanCan using `accessible_by`. 1. def load_resource 2. unless skip?(:load) 3. if load_instance? 4. self.resource_instance ||= load_resource_instance 5. elsif load_collection? 6. self.collection_instance ||= load_collection 7. end 8. end 9. end `collection_instance` is set on line 5 instead of line 6.
…nd a block - closes #269
…am - closes #296