|
|
@ -53,7 +53,7 @@ class RelationshipFilter
|
|
|
|
when 'activity'
|
|
|
|
when 'activity'
|
|
|
|
activity_scope(value)
|
|
|
|
activity_scope(value)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
raise "Unknown filter: #{key}"
|
|
|
|
raise Mastodon::InvalidParameterError, "Unknown filter: #{key}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -68,7 +68,7 @@ class RelationshipFilter
|
|
|
|
when 'invited'
|
|
|
|
when 'invited'
|
|
|
|
Account.joins(user: :invite).merge(Invite.where(user: account.user)).eager_load(:account_stat).reorder(nil)
|
|
|
|
Account.joins(user: :invite).merge(Invite.where(user: account.user)).eager_load(:account_stat).reorder(nil)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
raise "Unknown relationship: #{value}"
|
|
|
|
raise Mastodon::InvalidParameterError, "Unknown relationship: #{value}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -83,7 +83,7 @@ class RelationshipFilter
|
|
|
|
when 'remote'
|
|
|
|
when 'remote'
|
|
|
|
Account.remote
|
|
|
|
Account.remote
|
|
|
|
else
|
|
|
|
else
|
|
|
|
raise "Unknown location: #{value}"
|
|
|
|
raise Mastodon::InvalidParameterError, "Unknown location: #{value}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -94,7 +94,7 @@ class RelationshipFilter
|
|
|
|
when 'primary'
|
|
|
|
when 'primary'
|
|
|
|
Account.where(moved_to_account_id: nil)
|
|
|
|
Account.where(moved_to_account_id: nil)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
raise "Unknown status: #{value}"
|
|
|
|
raise Mastodon::InvalidParameterError, "Unknown status: #{value}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -105,7 +105,7 @@ class RelationshipFilter
|
|
|
|
when 'recent'
|
|
|
|
when 'recent'
|
|
|
|
params[:relationship] == 'invited' ? Account.recent : Follow.recent
|
|
|
|
params[:relationship] == 'invited' ? Account.recent : Follow.recent
|
|
|
|
else
|
|
|
|
else
|
|
|
|
raise "Unknown order: #{value}"
|
|
|
|
raise Mastodon::InvalidParameterError, "Unknown order: #{value}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -114,7 +114,7 @@ class RelationshipFilter
|
|
|
|
when 'dormant'
|
|
|
|
when 'dormant'
|
|
|
|
AccountStat.where(last_status_at: nil).or(AccountStat.where(AccountStat.arel_table[:last_status_at].lt(1.month.ago)))
|
|
|
|
AccountStat.where(last_status_at: nil).or(AccountStat.where(AccountStat.arel_table[:last_status_at].lt(1.month.ago)))
|
|
|
|
else
|
|
|
|
else
|
|
|
|
raise "Unknown activity: #{value}"
|
|
|
|
raise Mastodon::InvalidParameterError, "Unknown activity: #{value}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|