Class: LatestMigration::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/latest_migration/base.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.editorObject



16
17
18
# File 'lib/latest_migration/base.rb', line 16

def editor
  @editor ||= :subl
end

Class Method Details

.latest_migration_pathObject



11
12
13
14
# File 'lib/latest_migration/base.rb', line 11

def latest_migration_path
  filename = latest_migration_filename
  File.join(Rails.root, filename)
end

.open_latest_migrationObject



4
5
6
7
8
9
# File 'lib/latest_migration/base.rb', line 4

def open_latest_migration
  puts "Opening #{latest_migration_filename}"
  system editor_command
rescue LatestMigration::Errors::MigrationsNotFoundError => e
  puts e
end