diff --git a/app/models/note.rb b/app/models/note.rb index 0597a28..cd7f3a8 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -23,9 +23,6 @@ class Note < ActiveRecord::Base enum kind: {invoice: 0, credit: 1, income: 2, reminder: 3} - # Notes should be immutable and never changed. - #validate :force_immutable - before_create :generate_and_set_note_number before_create :generate_and_set_pdf before_update :generate_and_set_pdf @@ -85,11 +82,4 @@ def generate_and_set_note_number def generate_and_set_pdf self.generated_pdf = generate_pdf end - - def force_immutable - return unless changed? && persisted? - - errors.add(:base, :immutable) - reload - end end diff --git a/app/views/notes/_form.html.slim b/app/views/notes/_form.html.slim index 164e86f..8583076 100644 --- a/app/views/notes/_form.html.slim +++ b/app/views/notes/_form.html.slim @@ -21,7 +21,7 @@ = f.label :costs, class: 'label' table.table thead - th Datum + th Aantal th width='60%' Omschrijving th Bedrag th