Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cancan
Manage
Activity
Members
Plan
External wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Github Mirror
coopdevs
cancan
Commits
3885f469
Commit
3885f469
authored
14 years ago
by
Ryan Bates
Browse files
Options
Downloads
Patches
Plain Diff
updating changelog
parent
e2910a74
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.rdoc
+21
-0
21 additions, 0 deletions
CHANGELOG.rdoc
spec/cancan/model_adapters/mongoid_adapter_spec.rb
+4
-4
4 additions, 4 deletions
spec/cancan/model_adapters/mongoid_adapter_spec.rb
with
25 additions
and
4 deletions
CHANGELOG.rdoc
+
21
−
0
View file @
3885f469
1.5.0 (not yet released)
* Added an Ability generator - see issue #170
* Added DataMapper support (thanks natemueller)
* Added Mongoid support (thanks bowsersenior)
* Added skip_load_and_authorize_resource methods to controller class - see issue #164
* Added support for uncountable resources in index action - see issue #193
* Cleaned up README and added spec/README
* Internal: renamed CanDefinition to Rule
* Internal: added a model adapter layer for easily supporting more ORMs
* Internal: added .rvmrc to auto-switch to 1.8.7 with gemset - see issue #231
1.4.1 (November 12, 2010)
* Renaming skip_authorization to skip_authorization_check - see issue #169
...
...
This diff is collapsed.
Click to expand it.
spec/cancan/model_adapters/mongoid_adapter_spec.rb
+
4
−
4
View file @
3885f469
...
...
@@ -135,18 +135,18 @@ if ENV["MODEL_ADAPTER"] == "mongoid"
obj2
=
MongoidProject
.
create
(
:age
=>
40
)
@ability
.
can?
(
:read
,
obj2
).
should
==
false
end
it
"should handle instance not saved to database"
do
obj
=
MongoidProject
.
new
(
:title
=>
'Sir'
)
@ability
.
can
:read
,
MongoidProject
,
:title
.
in
=>
[
"Sir"
,
"Madam"
]
@ability
.
can?
(
:read
,
obj
).
should
==
true
# accessible_by only returns saved records
MongoidProject
.
accessible_by
(
@ability
,
:read
).
entries
.
should
==
[]
obj2
=
MongoidProject
.
new
(
:title
=>
'Lord'
)
@ability
.
can?
(
:read
,
obj2
).
should
==
false
end
end
end
it
"should call where with matching ability conditions"
do
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment