Sha256: 24ce5dcc7d9cba35f6a1bc214294d5c4912642c0461f7c5ed5f1ffcca5154edd
Contents?: true
Size: 1010 Bytes
Versions: 31
Compression:
Stored size: 1010 Bytes
Contents
# frozen_string_literal: true require 'rails/generators/active_record' module Emailbutler module Generators class ActiveRecordGenerator < ::Rails::Generators::Base include ::Rails::Generators::Migration desc 'Generates migration for emailbutler tables' source_paths << File.join(File.dirname(__FILE__), 'templates') def self.next_migration_number(dirname) ::ActiveRecord::Generators::Base.next_migration_number(dirname) end def self.migration_version "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" if requires_migration_number? end def self.requires_migration_number? Rails::VERSION::MAJOR.to_i >= 5 end def create_migration_file options = { migration_version: migration_version } migration_template 'migration.erb', 'db/migrate/create_emailbutler_tables.rb', options end def migration_version self.class.migration_version end end end end
Version data entries
31 entries across 31 versions & 1 rubygems