Module: ActsAsApprovable::Ownership::InstanceMethods
- Defined in:
- lib/acts_as_approvable/ownership.rb
Overview
Instance methods for approval ownership.
Instance Method Summary collapse
-
#assign(owner) ⇒ Boolean
Set the owner and save the record.
-
#unassign ⇒ Boolean
Removed any assigned owner and save the record.
Instance Method Details
#assign(owner) ⇒ Boolean
Set the owner and save the record.
45 46 47 48 49 |
# File 'lib/acts_as_approvable/ownership.rb', line 45 def assign(owner) raise ActsAsApprovable::Error::InvalidOwner unless self.class.available_owners.include?(owner) self.owner = owner save end |
#unassign ⇒ Boolean
Removed any assigned owner and save the record.
55 56 57 58 |
# File 'lib/acts_as_approvable/ownership.rb', line 55 def unassign self.owner = nil save end |