Skip to content

Commit

Permalink
move acts_as_federails_actor out of concern so we can configure indep…
Browse files Browse the repository at this point in the history
…dendently
  • Loading branch information
Floppy committed Aug 10, 2024
1 parent 29d5b8a commit f709ef8
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/models/collection.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Collection < ApplicationRecord
include Followable
acts_as_federails_actor username_field: :slug, name_field: :name, profile_url_method: :url_for, actor_type: "Collection"

has_many :models, dependent: :nullify
has_many :collections, dependent: :nullify
Expand Down
1 change: 0 additions & 1 deletion app/models/concerns/followable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module Followable
include FederailsCommon

included do
acts_as_federails_actor username_field: :id, name_field: :name, profile_url_method: :url_for
delegate :following_followers, to: :actor
after_create :post_creation_activity
after_update :post_update_activity
Expand Down
1 change: 0 additions & 1 deletion app/models/concerns/follower.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module Follower
include FederailsCommon

included do
acts_as_federails_actor username_field: :username, name_field: :name
delegate :activities, to: :actor
delegate :following_follows, to: :actor
end
Expand Down
1 change: 1 addition & 0 deletions app/models/creator.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Creator < ApplicationRecord
include Followable
acts_as_federails_actor username_field: :slug, name_field: :name, profile_url_method: :url_for

has_many :models, dependent: :nullify
has_many :links, as: :linkable, dependent: :destroy
Expand Down
2 changes: 2 additions & 0 deletions app/models/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ class Model < ApplicationRecord
include PathParser
include Followable

acts_as_federails_actor username_field: :slug, name_field: :name, profile_url_method: :url_for, actor_type: "Document"

scope :recent, -> { order(created_at: :desc) }

belongs_to :library
Expand Down
2 changes: 2 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ class User < ApplicationRecord
include Lister
include Follower

acts_as_federails_actor username_field: :username, name_field: :username

rolify
devise :database_authenticatable,
:registerable, :zxcvbnable,
Expand Down

0 comments on commit f709ef8

Please sign in to comment.