small styling changes
This commit is contained in:
parent
8002091d67
commit
46da8310f5
3 changed files with 4 additions and 3 deletions
|
|
@ -65,11 +65,11 @@ class CommentsController < ApplicationController
|
|||
if user_signed_in?
|
||||
@post = current_user.find_visible_shareable_by_id(Post, params[:post_id])
|
||||
else
|
||||
@post = Post.where(:id => params[:post_id], :public => true).includes(:author, :comments => :author).first
|
||||
@post = Post.find_by_id_and_public(params[:post_id], true)
|
||||
end
|
||||
|
||||
if @post
|
||||
@comments = @post.comments.includes(:author => :profile).order('created_at ASC')
|
||||
@comments = @post.comments.for_a_stream
|
||||
respond_with do |format|
|
||||
format.json { render :json => @comments.as_api_response(:backbone), :status => 200 }
|
||||
format.mobile{render :layout => false}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ class Comment < ActiveRecord::Base
|
|||
|
||||
|
||||
scope :including_author, includes(:author => :profile)
|
||||
scope :for_a_stream, including_author.merge(order('created_at ASC'))
|
||||
|
||||
before_save do
|
||||
self.text.strip! unless self.text.nil?
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ class Person < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def public_key_hash
|
||||
Base64.encode64 OpenSSL::Digest::SHA256.new(self.exported_key).to_s
|
||||
Base64.encode64(OpenSSL::Digest::SHA256.new(self.exported_key).to_s)
|
||||
end
|
||||
|
||||
def public_key
|
||||
|
|
|
|||
Loading…
Reference in a new issue