Automatically add accessible_by to Mongoid Documents to match CanCan behavior for ActiveRecord and DataMapper.
Previously, CanCan::ModelAdditions had to be included in each and every Mongoid document separately. Also removed manual include of CanCan::ModelAdditions from Mongoid documents in Mongoid adapter specs.
This commit is contained in:
@@ -3,14 +3,12 @@ if ENV["MODEL_ADAPTER"] == "mongoid"
|
||||
|
||||
class MongoidCategory
|
||||
include Mongoid::Document
|
||||
include CanCan::ModelAdditions
|
||||
|
||||
references_many :mongoid_projects
|
||||
end
|
||||
|
||||
class MongoidProject
|
||||
include Mongoid::Document
|
||||
include CanCan::ModelAdditions
|
||||
|
||||
referenced_in :mongoid_category
|
||||
|
||||
|
||||
Reference in New Issue
Block a user