cleanup old attributes from code

This commit is contained in:
Benjamin Neff 2016-08-03 01:09:47 +02:00
parent 7ff18d92fb
commit ecd13fc713
6 changed files with 8 additions and 18 deletions

View file

@ -334,7 +334,6 @@ app.views.Publisher = Backbone.View.extend({
"author" : app.currentUser ? app.currentUser.attributes : {}, "author" : app.currentUser ? app.currentUser.attributes : {},
"mentioned_people" : mentionedPeople, "mentioned_people" : mentionedPeople,
"photos" : photos, "photos" : photos,
"frame_name" : "status",
"title" : serializedForm["status_message[text]"], "title" : serializedForm["status_message[text]"],
"location" : location, "location" : location,
"interactions" : {"likes":[],"reshares":[],"comments_count":0,"likes_count":0,"reshares_count":0}, "interactions" : {"likes":[],"reshares":[],"comments_count":0,"likes_count":0,"reshares_count":0},

View file

@ -15,7 +15,7 @@ class PostPresenter < BasePresenter
private private
def directly_retrieved_attributes 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 end
def non_directly_retrieved_attributes def non_directly_retrieved_attributes

View file

@ -5,9 +5,6 @@ module Export
:public, :public,
:diaspora_handle, :diaspora_handle,
:type, :type,
:image_url,
:image_height,
:image_width,
:likes_count, :likes_count,
:comments_count, :comments_count,
:reshares_count, :reshares_count,

View file

@ -109,14 +109,13 @@ module Diaspora; module Fetcher; class Public
:author => @person, :author => @person,
:public => true :public => true
) )
entry.assign_attributes({ entry.assign_attributes(
:guid => post['guid'], guid: post["guid"],
:text => post['text'], text: post["text"],
:provider_display_name => post['provider_display_name'], provider_display_name: post["provider_display_name"],
:created_at => ActiveSupport::TimeZone.new('UTC').parse(post['created_at']).to_datetime, created_at: ActiveSupport::TimeZone.new("UTC").parse(post["created_at"]).to_datetime,
:interacted_at => ActiveSupport::TimeZone.new('UTC').parse(post['interacted_at']).to_datetime, interacted_at: ActiveSupport::TimeZone.new("UTC").parse(post["interacted_at"]).to_datetime
:frame_name => post['frame_name'] )
})
entry.save entry.save
# re-enable everything we disabled before # re-enable everything we disabled before

View file

@ -81,13 +81,11 @@ var factory = {
"interacted_at" : '2012-01-03T19:53:13Z', "interacted_at" : '2012-01-03T19:53:13Z',
"public" : false, "public" : false,
"guid" : this.guid(), "guid" : this.guid(),
"image_url" : null,
"o_embed_cache" : null, "o_embed_cache" : null,
"open_graph_cache": null, "open_graph_cache": null,
"photos" : [], "photos" : [],
"text" : "jasmine is bomb", "text" : "jasmine is bomb",
"id" : this.id.next(), "id" : this.id.next(),
"object_url" : null,
"root" : null, "root" : null,
"post_type" : "StatusMessage", "post_type" : "StatusMessage",
"interactions" : { "interactions" : {

View file

@ -9,9 +9,6 @@ describe Export::PostSerializer do
it { is_expected.to include %("public":#{post.public}) } it { is_expected.to include %("public":#{post.public}) }
it { is_expected.to include %("diaspora_handle":"#{post.diaspora_handle}") } it { is_expected.to include %("diaspora_handle":"#{post.diaspora_handle}") }
it { is_expected.to include %("type":"#{post.type}") } 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 %("likes_count":#{post.likes_count}) }
it { is_expected.to include %("comments_count":#{post.comments_count}) } it { is_expected.to include %("comments_count":#{post.comments_count}) }
it { is_expected.to include %("reshares_count":#{post.reshares_count}) } it { is_expected.to include %("reshares_count":#{post.reshares_count}) }