Compare commits

..

No commits in common. "master" and "1.6.10" have entirely different histories.

View File

@ -24,10 +24,6 @@ module CanCan
def load_and_authorize_resource def load_and_authorize_resource
load_resource load_resource
authorize_resource authorize_resource
if update_actions.include?(@params[:action].to_sym)
update_resource
authorize_resource # Reauthorize the now-updated resource
end
end end
def load_resource def load_resource
@ -90,10 +86,6 @@ module CanCan
assign_attributes(resource) assign_attributes(resource)
end end
def update_resource
resource.assign_attributes(resource_params || {})
end
def assign_attributes(resource) def assign_attributes(resource)
resource.send("#{parent_name}=", parent_resource) if @options[:singleton] && parent_resource resource.send("#{parent_name}=", parent_resource) if @options[:singleton] && parent_resource
initial_attributes.each do |attr_name, value| initial_attributes.each do |attr_name, value|
@ -260,10 +252,6 @@ module CanCan
[:new, :create] + [@options[:new]].flatten [:new, :create] + [@options[:new]].flatten
end end
def update_actions
[:update] #TODO: check what @options is for
end
private private
def extract_key(value) def extract_key(value)