Fixed new pronto warnings after develop branch sync

This commit is contained in:
Hank Grabowski 2018-12-30 17:04:35 -05:00
parent 89f918c486
commit ce01946eb0
10 changed files with 10 additions and 2 deletions

View file

@ -110,6 +110,7 @@ module Api
def find_post
post = post_service.find!(params[:post_id])
return post if post.public? || private_read?
raise ActiveRecord::RecordNotFound
end
end

View file

@ -81,6 +81,7 @@ module Api
def find_post
post = post_service.find!(params[:post_id])
raise ActiveRecord::RecordNotFound unless post.public? || private_read?
post
end
end

View file

@ -59,6 +59,7 @@ module Api
def add_location_params(mapped_parameters)
return unless params.has_key?(:location)
location = params.require(:location)
mapped_parameters[:location_address] = location[:address]
mapped_parameters[:location_coords] = "#{location[:lat]},#{location[:lng]}"

View file

@ -29,6 +29,7 @@ module Api
person = if params.has_key?(:id)
found_person = Person.find_by!(guid: params[:id])
raise ActiveRecord::RecordNotFound unless found_person.searchable || access_token?("contacts:read")
found_person
else
current_user.person

View file

@ -70,6 +70,7 @@ module User::Querying
def posts_from(person, with_order=true)
base_query = Post.from_person_visible_by_user(self, person)
return base_query.order("posts.created_at desc") if with_order
base_query
end

View file

@ -25,6 +25,7 @@ module User::SocialActions
def reshare!(target, opts={})
raise I18n.t("reshares.create.error") if target.author.guid == guid
build_post(:reshare, :root_guid => target.guid).tap do |reshare|
reshare.save!
update_or_create_participation!(target)

View file

@ -17,7 +17,6 @@ class PostPresenter < BasePresenter
end
def as_api_response
interactions = PostInteractionPresenter.new(@post, current_user)
{
guid: @post.guid,
body: build_text,
@ -28,7 +27,7 @@ class PostPresenter < BasePresenter
nsfw: @post.nsfw,
author: PersonPresenter.new(@post.author).as_api_json,
provider_display_name: @post.provider_display_name,
interaction_counters: interactions.as_counters,
interaction_counters: PostInteractionPresenter.new(@post, current_user).as_counters,
location: @post.post_location,
poll: PollPresenter.new(@post.poll, current_user).as_api_json,
mentioned_people: build_mentioned_people_json,

View file

@ -34,6 +34,7 @@ class ProfilePresenter < BasePresenter
def as_other_api_json(all_details)
return base_api_json unless all_details
base_api_json.merge(added_details_api_json)
end

View file

@ -46,6 +46,7 @@ class NotificationService
def update_status_by_guid(guid, is_read_status)
notification = get_by_guid(guid)
raise ActiveRecord::RecordNotFound unless notification
notification.set_read_state(is_read_status)
true
end

View file

@ -37,6 +37,7 @@ describe Api::Paging::IndexPaginator do
until page&.empty?
page_count += 1
break unless pager.next_page
np = pager.next_page.split("=").last.to_i
pager = Api::Paging::IndexPaginator.new(@alice_search, np, @limit)
page = pager.page_data