Skip to content

Commit

Permalink
Fixed post ID
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiahzs committed Jan 14, 2018
1 parent d5cba30 commit 59e619e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/se/api/types/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ class Post

def initialize(item_json)
@json = item_json
@body = item_json["body"]
@title = item_json["title"]
@link = item_json["link"]
@score = item_json["score"].to_i
@type = item_json["post_type"]
@id = item_json["id"].to_i
@updated_at = item_json["last_activity_date"]
@created_at = item_json["creation_date"]
@body = @json["body"]
@title = @json["title"]
@link = @json["link"]
@score = @json["score"].to_i
@type = @json["post_type"]
@id = (@json["post_id"] || @json["answer_id"] || @json["question_id"]).to_i
@updated_at = @json["last_activity_date"]
@created_at = @json["creation_date"]
@last_activity_date = @updated_at
# @author = User.new(item_json["author"])
end
Expand Down

0 comments on commit 59e619e

Please sign in to comment.