Class: Breeze::ActiveBase

Inherits:
ActiveYaml show all
Defined in:
app/models/breeze/active_base.rb

Direct Known Subclasses

Image, ViewBase

Instance Attribute Summary

Attributes inherited from ActiveYaml

#data

Instance Method Summary collapse

Methods inherited from ActiveYaml

all, append, define_access, define_association, delete, fields, find, find_all, find_by, first, full_path, #id, #id=, #initialize, load_file, #persisted?, primary_key, reload, save_all, set_root_path, the_meta_class

Constructor Details

This class inherits a constructor from Breeze::ActiveYaml

Instance Method Details

#add_save(editor) ⇒ Object



16
17
18
19
20
# File 'app/models/breeze/active_base.rb', line 16

def add_save( editor )
  self.updated_at = Time.now
  self.updated_by = editor
  add_save!(editor)
end

#add_save!(editor) ⇒ Object



22
23
24
25
# File 'app/models/breeze/active_base.rb', line 22

def add_save!(editor)
  ChangeSet.current.add(self.class.name , self.change_name, editor)
  self.class.save_all
end

#delete_save!(editor) ⇒ Object



27
28
29
30
31
# File 'app/models/breeze/active_base.rb', line 27

def delete_save!(editor)
  ChangeSet.current.delete(self.class.name , self.change_name,editor)
  self.class.delete(self.id)
  self.class.save_all
end

#edit_save(editor) ⇒ Object



5
6
7
8
9
# File 'app/models/breeze/active_base.rb', line 5

def edit_save( editor )
  self.updated_at = Time.now
  self.updated_by = editor
  edit_save!(editor)
end

#edit_save!(editor) ⇒ Object



11
12
13
14
# File 'app/models/breeze/active_base.rb', line 11

def edit_save!(editor)
  ChangeSet.current.edit(self.class.name , self.change_name, editor)
  self.class.save_all
end