Module: Access::Savable

Included in:
Privilege, Role, User
Defined in:
lib/access/savable.rb

Overview

Mixin for classes representing records Requires a method base (Savable creates an accessor to @base) and an #oid method.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#accessObject

The Access instance that manages this records base



17
18
19
# File 'lib/access/savable.rb', line 17

def access
  @access
end

#baseObject

The “Base” instance that manages this record



20
21
22
# File 'lib/access/savable.rb', line 20

def base
  @base
end

Instance Method Details

#deleteObject

delete this record from the database



28
29
30
# File 'lib/access/savable.rb', line 28

def delete
	base.delete(oid())
end

#saveObject

save changes to this record



23
24
25
# File 'lib/access/savable.rb', line 23

def save
	base.save(oid())
end