Skip to content

Commit

Permalink
Using a more efficient and less boneheaded way to do Accessors#parent…
Browse files Browse the repository at this point in the history
…_name.

git-svn-id: http://svn.hamptoncatlin.com/make_resourceful/trunk@163 c18eca5a-f828-0410-9317-b2e082e89db6
  • Loading branch information
nex3 committed Nov 16, 2007
1 parent 7ba2dd6 commit d2f30d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/resourceful/default/accessors.rb
Expand Up @@ -235,7 +235,7 @@ def parent?
# Finally, note that parents must be declared via Builder#belongs_to.
def parent_name
return @parent_name if defined?(@parent_name)
@parent_name = parent_names.find { |name| params.keys.any? { |key| key == "#{name}_id" } }
@parent_name = parent_names.find { |name| params.keys["#{name}_id"] }
end

# Returns the model class of the current parent.
Expand Down

0 comments on commit d2f30d6

Please sign in to comment.