Skip to content

Commit

Permalink
fix/conserta chamada de profile no report controller
Browse files Browse the repository at this point in the history
  • Loading branch information
anaresgalla committed Feb 15, 2024
1 parent bcf0f1e commit 039213f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/controllers/reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ def remove_profile

def set_reportable_for_new
reportable_id = params[:reportable]
@reportable = Post.find(reportable_id) if params[:reportable_type] == 'Post'
@reportable = Profile.friendly.find(reportable_id) if params[:reportable_type] == 'Profile'
@reportable = Comment.find(reportable_id) if params[:reportable_type] == 'Comment'
@reportable = Reply.find(reportable_id) if params[:reportable_type] == 'Reply'
reportable_type = params[:reportable_type]
@reportable = Post.find(reportable_id) if reportable_type == 'Post'
@reportable = Profile.friendly.find(reportable_id) if reportable_type == 'Profile'
@reportable = Comment.find(reportable_id) if reportable_type == 'Comment'
@reportable = Reply.find(reportable_id) if reportable_type == 'Reply'
end

def set_reportable_for_create
Expand Down

0 comments on commit 039213f

Please sign in to comment.