diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-18 10:43:10 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-18 16:21:10 +0100 |
commit | a2e2e73c5ef7c9082810d77c831c50c91011e6d9 (patch) | |
tree | 86eb986b1cc598859c3930c52f09e243dce40f9a /railties/lib/rails/generators/resource_helpers.rb | |
parent | 4c00c65c58055b341b4ca59a38c3c93082049c84 (diff) | |
download | rails-a2e2e73c5ef7c9082810d77c831c50c91011e6d9.tar.gz rails-a2e2e73c5ef7c9082810d77c831c50c91011e6d9.tar.bz2 rails-a2e2e73c5ef7c9082810d77c831c50c91011e6d9.zip |
Ensure generators can be invoked by their shortcut and remove attr_reader tasks.
Diffstat (limited to 'railties/lib/rails/generators/resource_helpers.rb')
-rw-r--r-- | railties/lib/rails/generators/resource_helpers.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/resource_helpers.rb b/railties/lib/rails/generators/resource_helpers.rb index 99954e2292..7e00a222ed 100644 --- a/railties/lib/rails/generators/resource_helpers.rb +++ b/railties/lib/rails/generators/resource_helpers.rb @@ -9,10 +9,14 @@ module Rails mattr_accessor :skip_warn def self.included(base) #:nodoc: - base.send :attr_reader, :controller_name, :controller_class_name, :controller_file_name, - :controller_class_path, :controller_file_path + base.class_eval do + class_option :force_plural, :type => :boolean, :desc => "Forces the use of a plural ModelName" - base.send :class_option, :force_plural, :type => :boolean, :desc => "Forces the use of a plural ModelName" + no_tasks { + attr_reader :controller_name, :controller_class_name, :controller_file_name, + :controller_class_path, :controller_file_path + } + end end # Set controller variables on initialization. |