Adding Ability#merge

This commit is contained in:
Roger Campos
2011-10-31 14:08:50 +01:00
parent 9eebeb2155
commit 7797b37c7e
2 changed files with 20 additions and 0 deletions

View File

@@ -228,6 +228,13 @@ module CanCan
relevant_rules(action, subject).any?(&:only_raw_sql?)
end
def merge(ability)
ability.send(:rules).each do |rule|
rules << rule.dup
end
self
end
private
def unauthorized_message_keys(action, subject)