Module: DataMapper::Constraints::Migrations::Model

Defined in:
lib/data_mapper/constraints/migrations/model.rb

Instance Method Summary collapse

Instance Method Details

#auto_migrate_constraints_down(repository_name = self.repository_name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


21
22
23
24
25
26
27
28
29
# File 'lib/data_mapper/constraints/migrations/model.rb', line 21

def auto_migrate_constraints_down(repository_name = self.repository_name)
  return unless storage_exists?(repository_name)
  # TODO: this check should not be here
  return if self.respond_to?(:is_remixable?) && self.is_remixable?

  relationships(repository_name).each do |relationship|
    relationship.auto_migrate_constraints_down(repository_name)
  end
end

#auto_migrate_constraints_up(repository_name = self.repository_name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


11
12
13
14
15
16
17
18
# File 'lib/data_mapper/constraints/migrations/model.rb', line 11

def auto_migrate_constraints_up(repository_name = self.repository_name)
  # TODO: this check should not be here
  return if self.respond_to?(:is_remixable?) && self.is_remixable?

  relationships(repository_name).each do |relationship|
    relationship.auto_migrate_constraints_up(repository_name)
  end
end