assocs & deps

This commit is contained in:
Mayel 2021-02-18 14:45:59 +01:00
parent 526a5d8a8e
commit 68cbc09e30
6 changed files with 52 additions and 24 deletions

@ -0,0 +1 @@
Subproject commit 49f0cf2ea5450208ad74ee0be9060124a0e3fa2b

View file

@ -0,0 +1 @@
sobelow-1613583712

View file

@ -153,15 +153,20 @@ config :bonfire_data_social, Activity,
belongs_to: [subject_character: {Character, foreign_key: :subject_id, define_field: false}],
belongs_to: [subject_profile: {Profile, foreign_key: :subject_id, define_field: false}],
belongs_to: [object_post: {Post, foreign_key: :object_id, define_field: false}],
has_one: [like_count: {LikeCount, foreign_key: :id, references: :object_id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :object_id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :object_id}],
has_one: [replied: {Replied, foreign_key: :id, references: :object_id}],
has_one: [reply_to: {[through: [:replied, :reply_to]]}],
has_one: [object_created: {Created, foreign_key: :id, references: :object_id}],
has_one: [object_creator_user: {[through: [:object_created, :creator_user]]}],
has_one: [object_creator_character: {[through: [:object_created, :creator_character]]}],
has_one: [object_creator_profile: {[through: [:object_created, :creator_profile]]}]
belongs_to: [object_post_content: {PostContent, foreign_key: :object_id, define_field: false}],
has_one: [like_count: {LikeCount, foreign_key: :id, references: :object_id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :object_id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :object_id}],
has_one: [replied: {Replied, foreign_key: :id, references: :object_id}],
has_one: [reply_to: {[through: [:replied, :reply_to]]}],
has_one: [reply_to_post: {[through: [:replied, :reply_to_post]]}],
has_one: [reply_to_post_content: {[through: [:replied, :reply_to_post_content]]}],
has_one: [reply_to_creator_character: {[through: [:replied, :reply_to_creator_character]]}],
has_one: [reply_to_creator_profile: {[through: [:replied, :reply_to_creator_profile]]}],
has_one: [object_created: {Created, foreign_key: :id, references: :object_id}],
has_one: [object_creator_user: {[through: [:object_created, :creator_user]]}],
has_one: [object_creator_character: {[through: [:object_created, :creator_character]]}],
has_one: [object_creator_profile: {[through: [:object_created, :creator_profile]]}]
config :bonfire_data_social, Circle,
has_one: [caretaker: {Caretaker, foreign_key: :id}],
@ -184,24 +189,40 @@ config :bonfire_data_social, Mention, []
config :bonfire_data_social, Named, []
config :bonfire_data_social, Post,
has_one: [post_content: {PostContent, foreign_key: :id}],
has_one: [created: {Created, foreign_key: :id}],
has_one: [creator_user: {[through: [:created, :creator_user]]}],
has_one: [post_content: {PostContent, foreign_key: :id}],
has_one: [created: {Created, foreign_key: :id}],
has_one: [creator_user: {[through: [:created, :creator_user]]}],
has_one: [creator_character: {[through: [:created, :creator_character]]}],
has_one: [creator_profile: {[through: [:created, :creator_profile]]}],
has_one: [like_count: {LikeCount, foreign_key: :id}],
has_many: [likes: {Like, foreign_key: :liked_id, references: :id}],
has_one: [my_like: {Like, foreign_key: :liked_id, references: :id}],
has_one: [replied: {Replied, foreign_key: :id}],
has_one: [reply_to: {[through: [:replied, :reply_to]]}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id}]
has_one: [my_like: {Like, foreign_key: :liked_id, references: :id}],
has_one: [replied: {Replied, foreign_key: :id}],
has_one: [reply_to: {[through: [:replied, :reply_to]]}],
has_one: [reply_to_post: {[through: [:replied, :reply_to_post]]}],
has_one: [reply_to_post_content: {[through: [:replied, :reply_to_post_content]]}],
has_one: [reply_to_creator_character: {[through: [:replied, :reply_to_creator_character]]}],
has_one: [reply_to_creator_profile: {[through: [:replied, :reply_to_creator_profile]]}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id}],
has_one: [thread_post: {[through: [:replied, :thread_post]]}],
has_one: [thread_post_content: {[through: [:replied, :thread_post_content]]}]
config :bonfire_data_social, PostContent, []
config :bonfire_data_social, Replied,
belongs_to: [post: {Post, foreign_key: :id, define_field: false}],
belongs_to: [activity: {Activity, foreign_key: :id, references: :object_id, define_field: false}],
# has_one: [reply_to: {Replied, foreign_key: :reply_to_id}],
has_one: [reply_to_post: {Post, foreign_key: :id, references: :reply_to_id}],
has_one: [reply_to_post_content: {PostContent, foreign_key: :id, references: :reply_to_id}],
has_one: [reply_to_created: {Created, foreign_key: :id, references: :reply_to_id}],
has_one: [reply_to_creator_user: {[through: [:reply_to_created, :creator_user]]}],
has_one: [reply_to_creator_character: {[through: [:reply_to_created, :creator_character]]}],
has_one: [reply_to_creator_profile: {[through: [:reply_to_created, :creator_profile]]}],
# has_one: [like_count: {LikeCount, foreign_key: :id}],
has_many: [direct_replies: {Replied, foreign_key: :reply_to_id, references: :id}],
has_many: [thread_replies: {Replied, foreign_key: :thread_id, references: :id}]
has_many: [thread_replies: {Replied, foreign_key: :thread_id, references: :id}],
has_one: [thread_post: {Post, foreign_key: :id, references: :thread_id}],
has_one: [thread_post_content: {PostContent, foreign_key: :id, references: :thread_id}]
config :bonfire_data_social, Created,
belongs_to: [creator_user: {User, foreign_key: :creator_id, define_field: false}],

View file

@ -51,12 +51,12 @@ defmodule Bonfire.Web.Router do
live "/user/:username/:tab", Me.Web.ProfileLive
live "/user/:username/circles", Me.Web.CirclesLive
live "/user/:username/posts", Me.Web.PostsLive
live "/user/:username/posts/:post_id", Me.Web.ThreadLive
live "/user/:username/posts/:post_id", Me.Web.PostLive
live "/instance", Me.Web.InstanceLive
live "/post/:post_id", Me.Web.ThreadLive
live "/discussion/:post_id", Me.Web.ThreadLive
live "/post/:post_id", Me.Web.PostLive
live "/discussion/:post_id", Me.Web.PostLive
end

View file

@ -58,7 +58,11 @@ defmodule Bonfire.MixProject do
{:ex_machina, "~> 2.4", only: :test},
{:mock, "~> 0.3.0", only: :test},
{:zest, "~> 0.1"},
{:licensir, git: "https://github.com/mayel/licensir", branch: "pr", only: :dev, runtime: false}
# list dependencies & licenses
{:licensir, git: "https://github.com/mayel/licensir", branch: "pr", only: :dev, runtime: false},
# security auditing
# {:mix_audit, "~> 0.1", only: [:dev], runtime: false}
{:sobelow, "~> 0.8", only: :dev}
])
# |> IO.inspect()
end

View file

@ -15,10 +15,10 @@
"bonfire_fail": {:git, "https://github.com/bonfire-ecosystem/bonfire_fail", "353484ad3640539350d8f2fbef40ea29cbbebcff", [branch: "main"]},
"bonfire_geolocate": {:git, "https://github.com/bonfire-ecosystem/bonfire_geolocate", "fb66f054bac6b3a813956d7b2d6b1e99e48780b2", [branch: "main"]},
"bonfire_mailer": {:git, "https://github.com/bonfire-ecosystem/bonfire_mailer", "079c8519395ee199dd689dd8ed8df0257210a9ff", [branch: "main"]},
"bonfire_me": {:git, "https://github.com/bonfire-ecosystem/bonfire_me", "89ec7b11e3c2449d9d8e3e77c467e288631dd217", [branch: "main"]},
"bonfire_me": {:git, "https://github.com/bonfire-ecosystem/bonfire_me", "5988f59ffdfd6ce11e9920c26337a0ca8d4cb576", [branch: "main"]},
"bonfire_quantify": {:git, "https://github.com/bonfire-ecosystem/bonfire_quantify", "8ba494f9c88d8cc16b1e1a7908792168cb2c3fef", [branch: "main"]},
"bonfire_tag": {:git, "https://github.com/bonfire-ecosystem/bonfire_tag", "2af81f77e3374ef688dc062b7931eae107284807", [branch: "main"]},
"bonfire_ui_social": {:git, "https://github.com/bonfire-ecosystem/bonfire_ui_social", "c43084bd8d622e33b63886c41d478eb25aa82689", [branch: "main"]},
"bonfire_ui_social": {:git, "https://github.com/bonfire-ecosystem/bonfire_ui_social", "18b179361b7cbe33f077197fab432d52be4d790f", [branch: "main"]},
"bonfire_valueflows": {:git, "https://github.com/bonfire-ecosystem/bonfire_valueflows", "72db4e7a3a8fa819a37d44d959d7be347baaa0ca", [branch: "main"]},
"cachex": {:hex, :cachex, "3.3.0", "6f2ebb8f27491fe39121bd207c78badc499214d76c695658b19d6079beeca5c2", [:mix], [{:eternal, "~> 1.2", [hex: :eternal, repo: "hexpm", optional: false]}, {:jumper, "~> 1.0", [hex: :jumper, repo: "hexpm", optional: false]}, {:sleeplocks, "~> 1.1", [hex: :sleeplocks, repo: "hexpm", optional: false]}, {:unsafe, "~> 1.0", [hex: :unsafe, repo: "hexpm", optional: false]}], "hexpm", "d90e5ee1dde14cef33f6b187af4335b88748b72b30c038969176cd4e6ccc31a1"},
"certifi": {:hex, :certifi, "2.5.3", "70bdd7e7188c804f3a30ee0e7c99655bc35d8ac41c23e12325f36ab449b70651", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "ed516acb3929b101208a9d700062d520f3953da3b6b918d866106ffa980e1c10"},
@ -92,6 +92,7 @@
"recase": {:hex, :recase, "0.7.0", "3f2f719f0886c7a3b7fe469058ec539cb7bbe0023604ae3bce920e186305e5ae", [:mix], [], "hexpm", "36f5756a9f552f4a94b54a695870e32f4e72d5fad9c25e61bc4a3151c08a4e0c"},
"result": {:hex, :result, "1.3.0", "fd598eb0e084048157fffca7ef5f53803c6031c99691a78271dade7b4c479661", [:mix], [], "hexpm", "c7aca4eb90a1fc7b571d46c700f36b36e18bef28d9df3630b73f67d6bf60329c"},
"sleeplocks": {:hex, :sleeplocks, "1.1.1", "3d462a0639a6ef36cc75d6038b7393ae537ab394641beb59830a1b8271faeed3", [:rebar3], [], "hexpm", "84ee37aeff4d0d92b290fff986d6a95ac5eedf9b383fadfd1d88e9b84a1c02e1"},
"sobelow": {:hex, :sobelow, "0.11.0", "cdc17e3a9f1ea78dc55dbe0a03121cb6767fef737c6d9f1e62ee7e78730abccc", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "c57807bfe6f231338b657781f89ef0320b66a0dbe779aa911d6ed27cfa14ae6e"},
"socket": {:hex, :socket, "0.3.13", "98a2ab20ce17f95fb512c5cadddba32b57273e0d2dba2d2e5f976c5969d0c632", [:mix], [], "hexpm", "f82ea9833ef49dde272e6568ab8aac657a636acb4cf44a7de8a935acb8957c2e"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
"stream_data": {:hex, :stream_data, "0.5.0", "b27641e58941685c75b353577dc602c9d2c12292dd84babf506c2033cd97893e", [:mix], [], "hexpm", "012bd2eec069ada4db3411f9115ccafa38540a3c78c4c0349f151fc761b9e271"},