Class: Cranium::TestFramework::DatabaseSequence

Inherits:
DatabaseEntity show all
Defined in:
lib/cranium/test_framework/database_sequence.rb

Instance Attribute Summary

Attributes inherited from DatabaseEntity

#connection, #entity_name

Instance Method Summary collapse

Methods inherited from DatabaseEntity

cleanup, entities_created, #initialize

Constructor Details

This class inherits a constructor from Cranium::TestFramework::DatabaseEntity

Instance Method Details

#createObject



4
5
6
7
# File 'lib/cranium/test_framework/database_sequence.rb', line 4

def create
  connection.run "CREATE sequence #{entity_name}"
  self.class.entities_created << self
end

#destroyObject



11
12
13
# File 'lib/cranium/test_framework/database_sequence.rb', line 11

def destroy
  connection.run "DROP SEQUENCE #{entity_name}"
end