Class: Cassie::Schema::RollbackCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/cassie/schema/rollback_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ RollbackCommand

Returns a new instance of RollbackCommand.



5
6
7
# File 'lib/cassie/schema/rollback_command.rb', line 5

def initialize(version)
  @version = version
end

Instance Attribute Details

#versionObject (readonly)

Returns the value of attribute version.



3
4
5
# File 'lib/cassie/schema/rollback_command.rb', line 3

def version
  @version
end

Instance Method Details

#directionObject



9
10
11
# File 'lib/cassie/schema/rollback_command.rb', line 9

def direction
  :down
end

#executeObject



13
14
15
16
# File 'lib/cassie/schema/rollback_command.rb', line 13

def execute
  version.migration.down
  remove_from_history
end