Sha256: 29aed6d04ab1e8241bf65485c1a970b7c4692fa4961bbada0d9f352283427dc8

Contents?: true

Size: 759 Bytes

Versions: 50

Compression:

Stored size: 759 Bytes

Contents

# frozen_string_literal: true

require "rails/generators/active_record"

module ActiveRecord
  module Generators # :nodoc:
    class ApplicationRecordGenerator < ::Rails::Generators::Base # :nodoc:
      source_root File.expand_path("templates", __dir__)

      # FIXME: Change this file to a symlink once RubyGems 2.5.0 is required.
      def create_application_record
        template "application_record.rb", application_record_file_name
      end

      private

        def application_record_file_name
          @application_record_file_name ||=
            if namespaced?
              "app/models/#{namespaced_path}/application_record.rb"
            else
              "app/models/application_record.rb"
            end
        end
    end
  end
end

Version data entries

50 entries across 50 versions & 6 rubygems

Version Path
activerecord-5.2.8.1 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-5.2.8 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-5.2.7.1 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-5.2.7 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-5.2.6.3 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-5.2.6.2 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-5.2.6.1 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-5.2.6 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-5.2.4.6 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-5.2.5 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-5.2.4.5 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-5.2.4.4 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-5.2.4.3 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-6.0.2.2 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-5.2.4.2 lib/rails/generators/active_record/application_record/application_record_generator.rb
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/rails/generators/active_record/application_record/application_record_generator.rb
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-6.0.2.1 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-5.2.4.1 lib/rails/generators/active_record/application_record/application_record_generator.rb
activerecord-6.0.2 lib/rails/generators/active_record/application_record/application_record_generator.rb