mirror of
https://github.com/bonfire-networks/bonfire-app.git
synced 2024-05-15 23:52:41 +00:00
Add Settings
This commit is contained in:
parent
3fdc2e74e1
commit
e15cb5d377
4
.iex.exs
4
.iex.exs
|
@ -11,7 +11,7 @@ use Common.Utils
|
|||
import Bonfire.Me.Fake
|
||||
require Logger
|
||||
|
||||
if module_enabled?(Bonfire.Common.Test.Interactive) do
|
||||
if module_enabled?(Bonfire.Common.Test.Interactive) && Mix.env() == :test do
|
||||
# to run tests from iex
|
||||
|
||||
# Code.compiler_options(ignore_module_conflict: true)
|
||||
|
@ -27,6 +27,6 @@ if module_enabled?(Bonfire.Common.Test.Interactive) do
|
|||
Bonfire.Common.Test.Interactive.Helpers.ready
|
||||
|
||||
else
|
||||
Logger.info("IExWatchTests is not available")
|
||||
Logger.info("IExWatchTests is not running")
|
||||
end
|
||||
import_if_enabled Bonfire.Common.Test.Interactive.Helpers
|
||||
|
|
|
@ -56,7 +56,7 @@ alias Bonfire.Data.ActivityPub.{Actor, Peer, Peered}
|
|||
alias Bonfire.Boundaries.{Permitted, Stereotyped}
|
||||
alias Bonfire.Data.Edges.{Edge,EdgeTotal}
|
||||
alias Bonfire.Data.Identity.{
|
||||
Account, Accounted, Caretaker, CareClosure, Character, Credential, Email, Named, Self, User,
|
||||
Account, Accounted, Caretaker, CareClosure, Character, Credential, Email, Named, Self, Settings, User,
|
||||
}
|
||||
alias Bonfire.Data.Social.{
|
||||
Activity, APActivity, Article, Block, Bookmark, Boost, Created, Feed, FeedPublish,
|
||||
|
@ -253,11 +253,12 @@ config :bonfire_data_identity, Account,
|
|||
[code: quote do
|
||||
has_one :credential, unquote(Credential),foreign_key: :id
|
||||
has_one :email, unquote(Email), foreign_key: :id
|
||||
has_one :settings, unquote(Settings), foreign_key: :id
|
||||
many_to_many :users, unquote(User),
|
||||
join_through: "bonfire_data_identity_accounted",
|
||||
join_through: Accounted,
|
||||
join_keys: [account_id: :id, id: :id]
|
||||
many_to_many :shared_users, unquote(User),
|
||||
join_through: "bonfire_data_shared_user_accounts",
|
||||
many_to_many :shared_users, unquote(User), # optional
|
||||
join_through: Bonfire.Data.SharedUser,
|
||||
join_keys: [account_id: :id, shared_user_id: :id]
|
||||
end]
|
||||
|
||||
|
@ -306,6 +307,7 @@ config :bonfire_data_identity, User,
|
|||
has_one :instance_admin, unquote(InstanceAdmin), foreign_key: :id, on_replace: :update
|
||||
has_one :self, unquote(Self), foreign_key: :id
|
||||
has_one :shared_user, unquote(Bonfire.Data.SharedUser), foreign_key: :id
|
||||
has_one :settings, unquote(Settings), foreign_key: :id
|
||||
unquote_splicing(common.([:actor, :character, :created, :peered, :profile]))
|
||||
# multimixins
|
||||
unquote_splicing(common.([:controlled]))
|
||||
|
|
|
@ -19,5 +19,6 @@ config :bonfire_me, Bonfire.Me.Accounts,
|
|||
]
|
||||
|
||||
config :bonfire_me, Bonfire.Me.Users,
|
||||
discoverable: true, # whether profiles should be dicoverable by search engines (can be overriden in user settings)
|
||||
# TODO: not hooked up yet
|
||||
max_per_account: 5 # Maximum number of users that an account may create
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
defmodule Bonfire.Repo.Migrations.ImportSettings do
|
||||
use Ecto.Migration
|
||||
require Bonfire.Data.Identity.Settings.Migration
|
||||
|
||||
def change do
|
||||
Bonfire.Data.Identity.Settings.Migration.migrate_settings()
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue