diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 4137a06..1a5f4c1 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -9,6 +9,10 @@ module API @current_user end + def current_person + current_user.person unless current_user.nil? + end + def logout @current_user = nil end diff --git a/lib/api/v1/comments.rb b/lib/api/v1/comments.rb index f9d7956..b47fe1e 100644 --- a/lib/api/v1/comments.rb +++ b/lib/api/v1/comments.rb @@ -28,7 +28,7 @@ module API # Example Request: # POST api/v1/articles/12/comments?private_toke=234298743290432&body=new comment post ":id/comments" do - present environment.articles.find(params[:id]).comments.create(:author => current_user, :body => params[:body]), :with => Entities::Comment + present environment.articles.find(params[:id]).comments.create(:author => current_person, :body => params[:body]), :with => Entities::Comment end end -- libgit2 0.21.2