mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 03:07:52 +01:00
- Added Site settings > Authentication section - Create/edit/delete your custom oauth2 configurations - Login or signup with oauth2
26 lines
510 B
Ruby
26 lines
510 B
Ruby
class Tenant < ApplicationRecord
|
|
has_many :boards
|
|
has_many :o_auths
|
|
has_many :post_statuses
|
|
has_many :posts
|
|
has_many :users
|
|
|
|
enum brand_display_setting: [
|
|
:name_and_logo,
|
|
:name_only,
|
|
:logo_only,
|
|
:no_name_no_logo
|
|
]
|
|
|
|
enum status: [:active, :pending, :blocked]
|
|
|
|
after_initialize :set_default_status, if: :new_record?
|
|
|
|
validates :site_name, presence: true
|
|
validates :subdomain, presence: true, uniqueness: true
|
|
|
|
def set_default_status
|
|
self.status ||= :pending
|
|
end
|
|
end
|