Sha256: b134602f4276720c998b6ce47506df7685de9a3ef8e808e5408ae439094c3668
Contents?: true
Size: 1.05 KB
Versions: 12
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true require 'rails/generators' require 'rails/generators/active_record' module SolidErrors # # Rails generator used for setting up SolidErrors in a Rails application. # Run it with +bin/rails g solid_errors:install+ in your console. # class InstallGenerator < Rails::Generators::Base include ActiveRecord::Generators::Migration source_root File.expand_path("templates", __dir__) class_option :database, type: :string, aliases: %i(--db), desc: "The database for your migration. By default, the current environment's primary database is used." class_option :skip_migrations, type: :boolean, default: nil, desc: "Skip migrations" # Generates monolithic migration file that contains all database changes. def create_migration_file return if options[:skip_migrations] migration_template 'create_solid_errors_tables.rb.erb', File.join(db_migrate_path, "create_solid_errors_tables.rb") end private def migration_version "[#{ActiveRecord::VERSION::STRING.to_f}]" end end end
Version data entries
12 entries across 12 versions & 1 rubygems