From 1ceaf1d91e0fc11a15d70ea8163489665ec57c75 Mon Sep 17 00:00:00 2001 From: jnewland Date: Sun, 16 Sep 2007 17:41:02 +0000 Subject: [PATCH] whoops git-svn-id: http://jnewland.com/svn/public/ruby/rails/plugins/resource_this@15 9b6b69f6-dd27-0410-8144-a0f3c56a22ea --- lib/resource_this.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/resource_this.rb b/lib/resource_this.rb index 6f8ceb2..9a45899 100644 --- a/lib/resource_this.rb +++ b/lib/resource_this.rb @@ -7,7 +7,8 @@ module ClassMethods def resource_this(options = {}) options.assert_valid_keys(:class_name, :will_paginate, :sort_method) - singular_name = options[:class_name].downcase.singularize || controller_name.singularize + singular_name = controller_name.singularize + singular_name = options[:class_name].downcase.singularize unless options[:class_name].nil? class_name = options[:class_name] || singular_name.camelize plural_name = singular_name.pluralize will_paginate_index = options[:class_name] || false