ryanb/cancan — pull request #689 by suweller (2012-07-13 18:06:25+00:00)
Title: Switch rule creation order

Specific rules overrule/exclude generic rules and should therefore be defined first if both rules need to be evaluated.

An actual use case would be:
```` ruby
user.can :read, :documents, :user_id => user.id

if user.admin?
user.can :read, :documents
end
```` # relevant_rules => [:read, :documents], [:read, :documents, {:user_id => user.id}]

and the following would then not work, because of the `specificity` rule.
Given, `user.admin? #=> true`:
```` ruby
if user.admin?
user.can :read, :documents
end

user.can :read, :documents, :user_id => user.id
```` # relevant_rules => [:read, :documents, {:user_id => user.id}]