cleanup old attributes from code
This commit is contained in:
parent
7ff18d92fb
commit
ecd13fc713
6 changed files with 8 additions and 18 deletions
|
|
@ -334,7 +334,6 @@ app.views.Publisher = Backbone.View.extend({
|
|||
"author" : app.currentUser ? app.currentUser.attributes : {},
|
||||
"mentioned_people" : mentionedPeople,
|
||||
"photos" : photos,
|
||||
"frame_name" : "status",
|
||||
"title" : serializedForm["status_message[text]"],
|
||||
"location" : location,
|
||||
"interactions" : {"likes":[],"reshares":[],"comments_count":0,"likes_count":0,"reshares_count":0},
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class PostPresenter < BasePresenter
|
|||
private
|
||||
|
||||
def directly_retrieved_attributes
|
||||
%i(id guid public created_at interacted_at provider_display_name image_url object_url)
|
||||
%i(id guid public created_at interacted_at provider_display_name)
|
||||
end
|
||||
|
||||
def non_directly_retrieved_attributes
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@ module Export
|
|||
:public,
|
||||
:diaspora_handle,
|
||||
:type,
|
||||
:image_url,
|
||||
:image_height,
|
||||
:image_width,
|
||||
:likes_count,
|
||||
:comments_count,
|
||||
:reshares_count,
|
||||
|
|
|
|||
|
|
@ -109,14 +109,13 @@ module Diaspora; module Fetcher; class Public
|
|||
:author => @person,
|
||||
:public => true
|
||||
)
|
||||
entry.assign_attributes({
|
||||
:guid => post['guid'],
|
||||
:text => post['text'],
|
||||
:provider_display_name => post['provider_display_name'],
|
||||
:created_at => ActiveSupport::TimeZone.new('UTC').parse(post['created_at']).to_datetime,
|
||||
:interacted_at => ActiveSupport::TimeZone.new('UTC').parse(post['interacted_at']).to_datetime,
|
||||
:frame_name => post['frame_name']
|
||||
})
|
||||
entry.assign_attributes(
|
||||
guid: post["guid"],
|
||||
text: post["text"],
|
||||
provider_display_name: post["provider_display_name"],
|
||||
created_at: ActiveSupport::TimeZone.new("UTC").parse(post["created_at"]).to_datetime,
|
||||
interacted_at: ActiveSupport::TimeZone.new("UTC").parse(post["interacted_at"]).to_datetime
|
||||
)
|
||||
entry.save
|
||||
|
||||
# re-enable everything we disabled before
|
||||
|
|
|
|||
|
|
@ -81,13 +81,11 @@ var factory = {
|
|||
"interacted_at" : '2012-01-03T19:53:13Z',
|
||||
"public" : false,
|
||||
"guid" : this.guid(),
|
||||
"image_url" : null,
|
||||
"o_embed_cache" : null,
|
||||
"open_graph_cache": null,
|
||||
"photos" : [],
|
||||
"text" : "jasmine is bomb",
|
||||
"id" : this.id.next(),
|
||||
"object_url" : null,
|
||||
"root" : null,
|
||||
"post_type" : "StatusMessage",
|
||||
"interactions" : {
|
||||
|
|
|
|||
|
|
@ -9,9 +9,6 @@ describe Export::PostSerializer do
|
|||
it { is_expected.to include %("public":#{post.public}) }
|
||||
it { is_expected.to include %("diaspora_handle":"#{post.diaspora_handle}") }
|
||||
it { is_expected.to include %("type":"#{post.type}") }
|
||||
it { is_expected.to include %("image_url":#{post.image_url}) }
|
||||
it { is_expected.to include %("image_height":#{post.image_height}) }
|
||||
it { is_expected.to include %("image_width":#{post.image_width}) }
|
||||
it { is_expected.to include %("likes_count":#{post.likes_count}) }
|
||||
it { is_expected.to include %("comments_count":#{post.comments_count}) }
|
||||
it { is_expected.to include %("reshares_count":#{post.reshares_count}) }
|
||||
|
|
|
|||
Loading…
Reference in a new issue