record and show which comments were posted by e-mail, for no particular reason
This commit is contained in:
parent
db81f5ff3b
commit
e63e45af2b
|
@ -28,6 +28,7 @@ class="comment <%= comment.current_vote ? (comment.current_vote[:vote] == 1 ?
|
|||
<%= comment.has_been_edited?? "edited" : "" %>
|
||||
<%= raw(time_ago_in_words_label(comment.has_been_edited? ?
|
||||
comment.updated_at : comment.created_at).gsub(/^about /, "")) %> ago
|
||||
<%= comment.is_from_email?? "via e-mail" : "" %>
|
||||
<% end %>
|
||||
|
||||
<% if !comment.previewing %>
|
||||
|
|
8
db/migrate/20131228175805_add_comment_by_email_flag.rb
Normal file
8
db/migrate/20131228175805_add_comment_by_email_flag.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
class AddCommentByEmailFlag < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :comments, :is_from_email, :boolean, :default => false
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20131018201413) do
|
||||
ActiveRecord::Schema.define(:version => 20131228175805) do
|
||||
|
||||
create_table "comments", :force => true do |t|
|
||||
t.datetime "created_at", :null => false
|
||||
|
@ -28,6 +28,7 @@ ActiveRecord::Schema.define(:version => 20131018201413) do
|
|||
t.text "markeddown_comment", :limit => 16777215
|
||||
t.boolean "is_deleted", :default => false
|
||||
t.boolean "is_moderated", :default => false
|
||||
t.boolean "is_from_email", :default => false
|
||||
end
|
||||
|
||||
add_index "comments", ["confidence"], :name => "confidence_idx"
|
||||
|
|
|
@ -134,6 +134,7 @@ body.strip!
|
|||
c = Comment.new
|
||||
c.user_id = sending_user.id
|
||||
c.comment = body
|
||||
c.is_from_email = true
|
||||
|
||||
if parent.is_a?(Comment)
|
||||
c.story_id = parent.story_id
|
||||
|
|
Loading…
Reference in a new issue