allow SQL conditions to be used with a block

This commit is contained in:
Ryan Bates
2011-04-21 00:46:06 -07:00
parent c6f9abb6ab
commit 63865cc7d8
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -188,6 +188,14 @@ describe CanCan::Ability do
}.should raise_error(CanCan::Error, "You are not able to supply a block with a hash of conditions in read ranges ability. Use either one.")
end
it "does not raise an error when attempting to use a block with an array of SQL conditions" do
lambda {
@ability.can :read, :ranges, ["published = ?", true] do
false
end
}.should_not raise_error(CanCan::Error)
end
# Attributes