Commit 7697829e authored by Seth Charles's avatar Seth Charles Committed by Alessandro Rodi
Browse files

Fix instance variable not initialized warnings (#433)

Fix instance variable not initialised warnings
parent 74f6f66e
......@@ -170,7 +170,8 @@ module CanCan
end
def resource_instance
@controller.instance_variable_get("@#{instance_name}") if load_instance?
return unless load_instance? && @controller.instance_variable_defined?("@#{instance_name}")
@controller.instance_variable_get("@#{instance_name}")
end
def collection_instance=(instance)
......@@ -178,6 +179,7 @@ module CanCan
end
def collection_instance
return unless @controller.instance_variable_defined?("@#{instance_name.to_s.pluralize}")
@controller.instance_variable_get("@#{instance_name.to_s.pluralize}")
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment