mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-05-05 18:31:01 +09:00
Layer on top a more pleasant API for the default case
This commit is contained in:
@@ -2,5 +2,5 @@ class Account < ApplicationRecord
|
||||
include Joinable
|
||||
|
||||
has_one_attached :logo
|
||||
has_json settings: { restrict_room_creation_to_administrators: :boolean }, delegate: true
|
||||
has_settings restrict_room_creation_to_administrators: :boolean, max_invites: 10, name: "hero"
|
||||
end
|
||||
|
||||
@@ -45,6 +45,10 @@ module ActiveRecord
|
||||
end if delegate
|
||||
end
|
||||
end
|
||||
|
||||
def has_settings(schema)
|
||||
has_json settings: schema, delegate: true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user