Module: DataMapper::Is::Predefined::MigrationMethods

Defined in:
lib/dm-is-predefined/is/predefined.rb

Overview

Since:

  • 0.4.0

Instance Method Summary collapse

Instance Method Details

#auto_migrate!(repository_name = self.repository_name) ⇒ true

Auto-migrates the model, then creates all predefined resources.

Parameters:

  • repository_name (Symbol) (defaults to: self.repository_name)

    The repository to perform the migrations within.

Returns:

  • (true)

Since:

  • 0.4.0



38
39
40
41
42
43
# File 'lib/dm-is-predefined/is/predefined.rb', line 38

def auto_migrate!(repository_name=self.repository_name)
  result = super(repository_name)

  predefine!(repository_name)
  return result
end

#auto_upgrade!(repository_name = self.repository_name) ⇒ true

Auto-upgrades the model, then creates any missing predefined resources.

Parameters:

  • repository_name (Symbol) (defaults to: self.repository_name)

    The repository to perform the upgrade within.

Returns:

  • (true)

Since:

  • 0.4.0



56
57
58
59
60
61
# File 'lib/dm-is-predefined/is/predefined.rb', line 56

def auto_upgrade!(repository_name=self.repository_name)
  result = super(repository_name)

  predefine!(repository_name)
  return result
end