3639ca90eb
This reverts e3eab13b860ad6e21d7d 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.
= CanCan Specs == Running the specs To run the specs first run the +bundle+ command to install the necessary gems and the +rake+ command to run the specs. bundle rake The specs currently require Ruby 1.8.7. Ruby 1.9.2 support will be coming soon. == Model Adapters CanCan offers separate specs for different model adapters (such as Mongoid and Data Mapper). By default it will use Active Record but you can change this by setting the +MODEL_ADAPTER+ environment variable before running. You can run the +bundle+ command with this as well to ensure you have the installed gems. MODEL_ADAPTER=data_mapper bundle MODEL_ADAPTER=data_mapper rake The different model adapters you can specify are: * active_record (default) * data_mapper * mongoid You can also run the +spec_all+ rake task to run specs for each adapter. rake spec_all