Sha256: 10cb85c6dd930d4a32e220f587d56ac4765abf634c7dedef1b3c5faa6ef53871
Contents?: true
Size: 920 Bytes
Versions: 4
Compression:
Stored size: 920 Bytes
Contents
# frozen_string_literal: true require "rails/generators/migration" module Sail module Generators class InstallGenerator < ::Rails::Generators::Base include Rails::Generators::Migration source_root File.expand_path("../templates", __FILE__) desc "Create Sail migrations" def self.next_migration_number(path) if @prev_migration_nr @prev_migration_nr += 1 else @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i end @prev_migration_nr.to_s end def copy_migrations migration_template "create_sail_settings.rb", "db/migrate/create_sail_settings.rb", migration_version: migration_version end def migration_version "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" if Rails.version.start_with?("5") end end end end
Version data entries
4 entries across 4 versions & 1 rubygems