Class: ArCheckedMigration::Checker

Inherits:
Struct
  • Object
show all
Defined in:
lib/ar_checked_migration/checker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



4
5
6
# File 'lib/ar_checked_migration/checker.rb', line 4

def status
  @status
end

Instance Method Details

#safe?Boolean

Returns:

  • (Boolean)


5
6
7
8
9
10
11
12
# File 'lib/ar_checked_migration/checker.rb', line 5

def safe?
  status.down.all? do |migration|
    require migration.filename
    klass = migration.name.constantize

    klass.respond_to?(:is_safe) && klass.is_safe
  end
end