Deal with controller names on scaffold and add some helpers to deal with ActiveModel.
Methods
- C
- O
Attributes
[R] | controller_name |
Instance Protected methods
Loads the ORM::Generators::ActiveModel class. This class is responsible to tell scaffold entities how to generate an specific method for the ORM. Check Rails::Generators::ActiveModel for more information.
# File railties/lib/rails/generators/resource_helpers.rb, line 59 59: def orm_class 60: @orm_class ||= begin 61: # Raise an error if the class_option :orm was not defined. 62: unless self.class.class_options[:orm] 63: raise "You need to have :orm as class option to invoke orm_class and orm_instance" 64: end 65: 66: begin 67: "#{options[:orm].to_s.camelize}::Generators::ActiveModel".constantize 68: rescue NameError 69: Rails::Generators::ActiveModel 70: end 71: end 72: end