Skip to content
Browse files

Added ability to specify the name of a child relative to its parent

  • Loading branch information...
1 parent f901c36 commit 82ce87527e9676b781ee708e4ae5010259d06d8e @hunterae committed Oct 12, 2010
Showing with 3 additions and 3 deletions.
  1. +2 −2 cancan.gemspec
  2. +1 −1 lib/cancan/controller_resource.rb
View
4 cancan.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
- s.name = "cancan"
- s.version = "1.4.0"
+ s.name = "cancan_with_specified_name_in_parent"
+ s.version = "1.4.1"
s.author = "Ryan Bates"
s.email = "ryan@railscasts.com"
s.homepage = "http://github.com/ryanb/cancan"
View
2 lib/cancan/controller_resource.rb
@@ -132,7 +132,7 @@ def collection_instance
def resource_base
if @options[:through]
if parent_resource
- @options[:singleton] ? parent_resource : parent_resource.send(name.to_s.pluralize)
+ @options[:singleton] ? parent_resource : parent_resource.send(@options[:name_in_parent] || name.to_s.pluralize)
elsif @options[:shallow]
resource_class
else

0 comments on commit 82ce875

Please sign in to comment.
Something went wrong with that request. Please try again.