Commit 46da8310 authored by Maxwell Salzberg's avatar Maxwell Salzberg

small styling changes

parent 8002091d
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment