app/controllers/federails/client/followings_controller.rb in federails-0.3.0 vs app/controllers/federails/client/followings_controller.rb in federails-0.4.0
- old
+ new
@@ -30,11 +30,11 @@
# POST /app/followings
# POST /app/followings.json
def create
@following = Following.new(following_params)
- @following.actor = current_user.actor
+ @following.actor = current_user.federails_actor
authorize @following, policy_class: Federails::Client::FollowingPolicy
save_and_render
end
@@ -42,11 +42,11 @@
# POST /app/followings/follow.json
def follow
authorize Federails::Following, policy_class: Federails::Client::FollowingPolicy
begin
- @following = Following.new_from_account following_account_params, actor: current_user.actor
+ @following = Following.new_from_account following_account_params, actor: current_user.federails_actor
rescue ::ActiveRecord::RecordNotFound
# Renders a 422 instead of a 404
respond_to do |format|
format.html { redirect_to federails.client_actors_url, alert: I18n.t('controller.followings.follow.error') }
format.json { render json: { target_actor: ['does not exist'] }, status: :unprocessable_entity }
@@ -84,10 +84,10 @@
def following_account_params
params.require(:account)
end
def save_and_render # rubocop:disable Metrics/AbcSize
- url = federails.client_actor_url current_user.actor
+ url = federails.client_actor_url current_user.federails_actor
respond_to do |format|
if @following.save
format.html { redirect_to url, notice: I18n.t('controller.followings.save_and_render.success') }
format.json { render :show, status: :created, location: @following }