some mods
This commit is contained in:
parent
19754a8cec
commit
92eabd3be7
|
@ -14,20 +14,21 @@ class RegisteredSite
|
||||||
field :confirmation_token
|
field :confirmation_token
|
||||||
|
|
||||||
has_many :site_logs
|
has_many :site_logs
|
||||||
|
has_many :installed_modules
|
||||||
|
|
||||||
index({ confirmation_token: 1}, { unique: true })
|
index({ confirmation_token: 1}, { unique: true })
|
||||||
|
scope :active, ->{where(:access_granted => true,:site_confirmed => true)}
|
||||||
|
|
||||||
def site_token
|
def site_token
|
||||||
self.uid
|
self.uid
|
||||||
end
|
end
|
||||||
|
|
||||||
def generate_confirmation_token
|
def generate_confirmation_token
|
||||||
self.confirmation_token = SecureRandom.hex(5)
|
self.confirmation_token = SecureRandom.hex(5)
|
||||||
self.save
|
self.save
|
||||||
end
|
end
|
||||||
|
|
||||||
def active?
|
def active?
|
||||||
return self.access_granted && self.site_confirmed
|
return self.access_granted && self.site_confirmed
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
Loading…
Reference in New Issue