cleaning up some internal specs and names

This commit is contained in:
Ryan Bates
2010-09-03 14:00:46 -07:00
parent a744377ac9
commit 721939babd
7 changed files with 145 additions and 142 deletions

View File

@@ -209,7 +209,7 @@ module CanCan
def attributes_for(action, subject)
attributes = {}
relevant_can_definitions(action, subject).map do |can_definition|
attributes.merge!(can_definition.new_attributes) if can_definition.base_behavior
attributes.merge!(can_definition.attributes_from_conditions) if can_definition.base_behavior
end
attributes
end

View File

@@ -67,7 +67,7 @@ module CanCan
hash
end
def new_attributes
def attributes_from_conditions
attributes = {}
@conditions.each do |key, value|
attributes[key] = value unless [Array, Range, Hash].include? value.class