4602ded8a4
* start on access requests * set up access requests further * set default values for approved and answered
18 lines
385 B
Ruby
18 lines
385 B
Ruby
class AccessRequest < ApplicationRecord
|
|
belongs_to :user
|
|
belongs_to :map
|
|
|
|
def approve
|
|
self.approved = true
|
|
self.answered = true
|
|
self.save
|
|
UserMap.create(user: self.user, map: self.map)
|
|
MapMailer.invite_to_edit_email(self.map, self.map.user, self.user).deliver_later
|
|
end
|
|
|
|
def deny
|
|
self.approved = false
|
|
self.answered = true
|
|
self.save
|
|
end
|
|
end
|