instance method orm_class

Ruby on Rails 3.1.12

Since v3.0.20 Last seen in v3.2.22.5

Available in: v3.0.20 v3.1.12 v3.2.22.5

Signature

orm_class()

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.

Source
# File railties/lib/rails/generators/resource_helpers.rb, line 59
        def orm_class
          @orm_class ||= begin
            # Raise an error if the class_option :orm was not defined.
            unless self.class.class_options[:orm]
              raise "You need to have :orm as class option to invoke orm_class and orm_instance"
            end

            begin
              "#{options[:orm].to_s.classify}::Generators::ActiveModel".constantize
            rescue NameError => e
              Rails::Generators::ActiveModel
            end
          end
        end

Defined in railties/lib/rails/generators/resource_helpers.rb line 59 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::Generators::ResourceHelpers

Type at least 2 characters to search.

↑↓ navigate · open · esc close