Sha256: 9b0e53f253cee19796bc914e2b6475101d5339231cab73b26d595a24adced9c9
Contents?: true
Size: 882 Bytes
Versions: 5
Compression:
Stored size: 882 Bytes
Contents
# frozen_string_literal: true require 'rails/generators/active_record' module Stance module Generators class InstallGenerator < Rails::Generators::Base include ActiveRecord::Generators::Migration source_root File.join(__dir__, 'templates') desc 'Install Stance, including a database migration.' def copy_migration migration_template 'migration.rb', 'db/migrate/create_stance_event_record.rb', migration_version: migration_version end def migration_version "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]" end def properties_type case ActiveRecord::Base.connection_db_config.adapter when /postg/i # postgres, postgis 'jsonb' when /mysql/i 'json' else 'text' end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems