diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-01 20:30:47 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-02 10:27:40 +0200 |
commit | 7f7afdf0f11b6748ace1ee48f8d604637058001e (patch) | |
tree | 8412da6cf7abaa9cccb62fc4fbb9e43f660b41c4 /railties/lib/generators/rails/scaffold_controller | |
parent | 1a4d8aca8a675aa02cead4b1db53ba5a3f9aa326 (diff) | |
download | rails-7f7afdf0f11b6748ace1ee48f8d604637058001e.tar.gz rails-7f7afdf0f11b6748ace1ee48f8d604637058001e.tar.bz2 rails-7f7afdf0f11b6748ace1ee48f8d604637058001e.zip |
Rename ControllerNamedBase to ScaffoldBase and move ActionORM helpers.
Diffstat (limited to 'railties/lib/generators/rails/scaffold_controller')
-rw-r--r-- | railties/lib/generators/rails/scaffold_controller/scaffold_controller_generator.rb | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/railties/lib/generators/rails/scaffold_controller/scaffold_controller_generator.rb b/railties/lib/generators/rails/scaffold_controller/scaffold_controller_generator.rb index e73c139e96..c7c777014e 100644 --- a/railties/lib/generators/rails/scaffold_controller/scaffold_controller_generator.rb +++ b/railties/lib/generators/rails/scaffold_controller/scaffold_controller_generator.rb @@ -1,7 +1,8 @@ module Rails module Generators class ScaffoldControllerGenerator < NamedBase - include ControllerNamedBase + # Add controller methods and ActionORM settings. + include ScaffoldBase check_class_collision :suffix => "Controller" @@ -21,22 +22,6 @@ module Rails invoke_if :helper do |base, invoked| base.invoke invoked, [ base.controller_name ] end - - protected - - def orm_class - @orm_class ||= begin - action_orm = "#{options[:orm].to_s.classify}::Generators::ActionORM" - action_orm.constantize - rescue NameError => e - raise Error, "Could not load #{action_orm}, skipping controller. Error: #{e.message}." - end - end - - def orm_instance - @orm_instance ||= @orm_class.new(file_name) - end - end end end |