Class: Area

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/area.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) chekear_sin_notas



18
19
20
21
22
23
# File 'app/models/area.rb', line 18

def chekear_sin_notas
  if expedientes.count > 0
    errors.add :base, "No se puede borrar un area que contienen notas"
    false
  end
end

- (Object) chekear_sin_subareas



11
12
13
14
15
16
# File 'app/models/area.rb', line 11

def chekear_sin_subareas
  if areas.count > 0
    errors.add :base, "No se puede borrar un area que contienen otras areas"
    false
  end
end