Layer on top a more pleasant API for the default case

This commit is contained in:
David Heinemeier Hansson
2025-11-28 15:48:46 -08:00
parent 32be03a240
commit d3b6507ce2
2 changed files with 5 additions and 1 deletions

View File

@@ -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

View File

@@ -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