Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active Storage Module::DelegationError: size delegated to attachment, but attachment is nil #35613

Closed
RailsCod3rFuture opened this issue Mar 14, 2019 · 6 comments

Comments

@RailsCod3rFuture
Copy link

RailsCod3rFuture commented Mar 14, 2019

Steps to reproduce

post.rb

has_one_attached :photo

posts_controller.rb

def create
  @post = current_user.posts.build(post_params)
  @post.insight_photo.attach(params[:post][:photo])
  respond_to do |format|
    if @post.save
      format.js
      format.html {redirect_to posts_path}
    end
  end
end

rails console


>> @post = Post.new(id: 8, user_id: 1, body_text: "Testing photos in console", photo: File.open(Rails.root.join('app', 'assets', 'images', 'fallback', 'user_profile_bg_default.png')), created_at: Time.now)
#<Post id: 8, body_text: "Testing photos in console", photo: nil, user_id: 1, post_id: nil, created_at: "2019-03-14 20:05:50", updated_at: nil, impressions_count: nil, hash_id: nil, cached_votes_total: 0, cached_votes_score: 0, cached_votes_up: 0, cached_votes_down: 0, cached_weighted_score: 0, cached_weighted_total: 0, cached_weighted_average: 0.0, posts_count: 0>
>> @post.save
   (31.2ms)  BEGIN
  User Load (33.1ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
   (15.6ms)  ROLLBACK
Module::DelegationError: size delegated to attachment, but attachment is nil
	from (irb):17

Expected behavior

The post should save with the photo attached.

Actual behavior

The post is rolling back with a size delegated to attachment, but attachment is nil error.

System configuration

Rails version:

rails 5.2.0

Ruby version:

ruby 2.4.4

@gmcgibbon
Copy link
Member

Can you provide an example application that reproduces the error? Also, to attach a raw file with ActiveStorage, you need to do something like this:

Post.create(photo: { io: Rails.root.join("public", "something.jpg").open, filename: "picture.jpg"  })

See docs

@RailsCod3rFuture
Copy link
Author

RailsCod3rFuture commented Mar 15, 2019

After tinkering with the partial file that leads to this issue. I was able to get past this error, momentarily. The next Issue I have, is Active Storage is not saving the image when the form is posted through AJAX. I can understand the delay between the form POST and the server waiting for Active Storage to retrieve an image. But, no image is saved at all. (I'm using the latest remotipart gem). The avatar loads problem free, which I seeded into the database.

_form.html.erb

<%= simple_form_for(@post, html: {multipart: true}, method: :post, remote: true, authenticity_token: true) do |f| %>
  <%= f.error_notification %>
  <div class="row">
    <div class="col">
      <div class="post-textarea">
          <%= f.input :body_text, as: :text, class: 'form-control post-placeholder post-txt-area', label: false, placeholder: 'Write a new Post, style: "overflow: hidden; resize: none;", input_html: {:maxlength => 400}  %>
        </div>
      </div>
    </div>
  </div>
  <div class="row">
    <div class="col-md-5">
      <%= f.button :submit, 'Post', class: 'form-control submit-button bttn-gradient bttn-md bttn-royal', :data => {:disable_with => 'Posting now...'} %>
    </div>
    <div class="col-md-5">
      <label class="bttn-minimal bttn-md bttn-royal">
        Add Photo
        <span style="display:none;">
                <%= f.input :photo, as: :file, label: false, input_html: {accept: 'image/*'} %>
                </span>
      </label>
      <% if f.object.photo.attached? %>
        <%= image_tag(url_for(f.object.photo), class: 'img-responsive img-thumbnail') %>
      <% end %>
      <div class="post-preview-container">
        <img id="img_prev" width="100" height="100" src="#" alt="preview" class="img-thumbnail d-none"/> <br/>
        <a href="#" id="cancel_img_btn" class="d-none" onclick="return !(document.getElementById('post_photo').innerHTML=document.getElementById('post_photo').innerHTML);">Cancel
          Upload</a>
      </div>
    </div>
  </div>
<% end %>

create.js.erb

$("#container_posts").prepend("<%= escape_javascript render partial: "posts/#{@post.post_type}", locals: {post: @post } %>");
$("#post_<%= @post.id %>").hide().fadeIn(1000);
$("#no-posts").hide().fadeOut();
$("#post_body_text").val("");
$("#img_prev").hide().fadeOut();
$("#cancel_img_btn").hide().fadeOut();

alert('success!');
<% if remotipart_submitted? %>
alert('submitted via remotipart')
<% else %>
alert('submitted via native jquery-ujs')
<% end %>

The form submits, but forgets the photo was being uploaded. @gmcgibbon -- I don't know how to get past this error with Active Storage.

Server Log


Started POST "/posts" for 127.0.0.1 at 2019-03-14 20:28:37 -0400
Processing by PostsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"NMOMX0v6RdaSHw0sCqUy5fTDp7Gh9Lnaiq8T06dWuwJciG0lf6QxudH8QsytTlLZ8dbrsarSuCB/ASZipo44Jg==", "post"=>{"body_text"=>"Testing Active Storage Image Upload!"}, "commit"=>"Post"}
  User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", 1], ["LIMIT", 1]]
   (0.0ms)  BEGIN
  Post Exists (0.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."hash_id" = $1 LIMIT $2  [["hash_id", "2sh7LvVhX2X0"], ["LIMIT", 1]]
  Post Create (18.0ms)  INSERT INTO "posts" ("body_text", "user_id", "created_at", "updated_at", "hash_id") VALUES ($1, $2, $3, $4, $5) RETURNING "id"  [["body_text", "Testing Active Storage Image Upload!"], ["user_id", 1], ["created_at", "2019-03-15 00:28:38.747240"], ["updated_at", "2019-03-15 00:28:38.747240"], ["hash_id", "2sh7LvVhX2X0"]]
   (66.0ms)  COMMIT
   (0.0ms)  BEGIN
  User Load (1.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  NotifyFollower Create (2.0ms)  INSERT INTO "notify_followers" ("message", "user_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"  [["message", "posted a new career insight"], ["user_id", 1], ["created_at", "2019-03-15 00:28:38.962108"], ["updated_at", "2019-03-15 00:28:38.962108"]]
   (1.0ms)  COMMIT
[ActiveJob]   NotifyFollower Load (1.0ms)  SELECT  "notify_followers".* FROM "notify_followers" WHERE "notify_followers"."id" = $1 LIMIT $2  [["id", 23], ["LIMIT", 1]]
[ActiveJob] [PostFeedNotifierRelayJob] [56980cad-ccde-4dff-ad7b-48ed4fd23580] Performing PostFeedNotifierRelayJob (Job ID: 56980cad-ccde-4dff-ad7b-48ed4fd23580) from Inline(default) with arguments: #<GlobalID:0x0000000017dd0498 @uri=#<URI::GID gid://resume-future-app/NotifyFollower/23>>
[ActiveJob] [PostFeedNotifierRelayJob] [56980cad-ccde-4dff-ad7b-48ed4fd23580]   User Load (1.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
[ActiveJob] [PostFeedNotifierRelayJob] [56980cad-ccde-4dff-ad7b-48ed4fd23580]   Rendered notify_followers/_notify_follower.html.erb (4.0ms)
[ActiveJob] [PostFeedNotifierRelayJob] [56980cad-ccde-4dff-ad7b-48ed4fd23580] [ActionCable] Broadcasting to post_channel: {:message=>"<a style=\"text-decoration: none;\" href=\"/posts\">\n  <div class=\"alert alert-purple notify_follower career-insight-alert-pos\" role=\"alert\">\n    <p><i class=\"far fa-bell\"></i> jennyohjenny posted a new career insight</p>\n  </div>\n</a>"}
[ActiveJob] [PostFeedNotifierRelayJob] [56980cad-ccde-4dff-ad7b-48ed4fd23580] Performed PostFeedNotifierRelayJob (Job ID: 56980cad-ccde-4dff-ad7b-48ed4fd23580) from Inline(default) in 3474.12ms
PostChannel transmitting {"message"=>"<a style=\"text-decoration: none;\" href=\"/posts\">\n  <div class=\"alert alert-purple notify_follower career-insight-alert-pos\" role=\"alert\">\n    <p><i class=\"far fa-bell\"></i> jennyohjenny posted a new career insight</p>\n  </div>\n</a>"} (via streamed from post_channel)
[ActiveJob] Enqueued PostFeedNotifierRelayJob (Job ID: 56980cad-ccde-4dff-ad7b-48ed4fd23580) to Inline(default) with arguments: #<GlobalID:0x0000000017cdbdf8 @uri=#<URI::GID gid://resume-future-app/NotifyFollower/23>>
Redirected to http://127.0.0.1:3000/posts
Completed 302 Found in 5717ms (ActiveRecord: 100.0ms)


Started GET "/posts" for 127.0.0.1 at 2019-03-14 20:28:44 -0400
Processing by PostsController#index as HTML
  User Load (1.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", 1], ["LIMIT", 1]]
DEPRECATION WARNING: Setting custom parent classes is deprecated and will be removed in future versions. (called from parent_class_name at C:/Ruby24-x64/lib/ruby/gems/2.4.0/bundler/gems/acts_as_follower-c5ac7b9601c4/lib/acts_as_follower/follower_lib.rb:10)
   (1.0ms)  SELECT "users"."id" FROM "users" INNER JOIN "follows" ON "follows"."followable_id" = "users"."id" AND "follows"."followable_type" = $1 WHERE "follows"."blocked" = $2 AND "follows"."follower_id" = $3 AND "follows"."follower_type" = $4 AND "follows"."followable_type" = $5  [["followable_type", "User"], ["blocked", false], ["follower_id", 1], ["follower_type", "User"], ["followable_type", "User"]]
  UserProfile Load (1.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  Post Load (2.0ms)  SELECT  "posts".* FROM "posts" LEFT OUTER JOIN "active_storage_attachments" ON "active_storage_attachments"."record_id" = "posts"."id" AND "active_storage_attachments"."record_type" = $1 AND "active_storage_attachments"."name" = $2 WHERE "posts"."user_id" = $3 GROUP BY "posts"."id" HAVING (COUNT(active_storage_attachments) >= 1) ORDER BY "posts"."id" DESC LIMIT $4  [["record_type", "Post"], ["name", "insight_photo"], ["user_id", 1], ["LIMIT", 4]]
DEPRECATION WARNING: Setting custom parent classes is deprecated and will be removed in future versions. (called from parent_class_name at C:/Ruby24-x64/lib/ruby/gems/2.4.0/bundler/gems/acts_as_follower-c5ac7b9601c4/lib/acts_as_follower/follower_lib.rb:10)
  CACHE  (0.0ms)  SELECT "users"."id" FROM "users" INNER JOIN "follows" ON "follows"."followable_id" = "users"."id" AND "follows"."followable_type" = $1 WHERE "follows"."blocked" = $2 AND "follows"."follower_id" = $3 AND "follows"."follower_type" = $4 AND "follows"."followable_type" = $5  [["followable_type", "User"], ["blocked", false], ["follower_id", 1], ["follower_type", "User"], ["followable_type", "User"]]
DEPRECATION WARNING: Setting custom parent classes is deprecated and will be removed in future versions. (called from parent_class_name at C:/Ruby24-x64/lib/ruby/gems/2.4.0/bundler/gems/acts_as_follower-c5ac7b9601c4/lib/acts_as_follower/follower_lib.rb:10)
  CACHE  (0.0ms)  SELECT "users"."id" FROM "users" INNER JOIN "follows" ON "follows"."followable_id" = "users"."id" AND "follows"."followable_type" = $1 WHERE "follows"."blocked" = $2 AND "follows"."follower_id" = $3 AND "follows"."follower_type" = $4 AND "follows"."followable_type" = $5  [["followable_type", "User"], ["blocked", false], ["follower_id", 1], ["follower_type", "User"], ["followable_type", "User"]]
  Rendering posts/index.html.erb within layouts/application
DEPRECATION WARNING: Setting custom parent classes is deprecated and will be removed in future versions. (called from parent_class_name at C:/Ruby24-x64/lib/ruby/gems/2.4.0/bundler/gems/acts_as_follower-c5ac7b9601c4/lib/acts_as_follower/follower_lib.rb:10)
   (0.0ms)  SELECT COUNT(*) FROM "follows" WHERE "follows"."blocked" = $1 AND "follows"."follower_id" = $2 AND "follows"."follower_type" = $3  [["blocked", false], ["follower_id", 1], ["follower_type", "User"]]
   (1.0ms)  SELECT COUNT(*) FROM "follows" WHERE "follows"."followable_id" = $1 AND "follows"."followable_type" = $2 AND "follows"."blocked" = $3  [["followable_id", 1], ["followable_type", "User"], ["blocked", false]]
   (1.0ms)  SELECT COUNT(*) FROM "posts" WHERE "posts"."user_id" = $1  [["user_id", 1]]
  SimpleHashtag::Hashtag Load (2.0ms)  SELECT  "simple_hashtag_hashtags".* FROM "simple_hashtag_hashtags" LEFT OUTER JOIN "simple_hashtag_hashtaggings" ON "simple_hashtag_hashtaggings"."hashtag_id" = "simple_hashtag_hashtags"."id" WHERE (simple_hashtag_hashtaggings.created_at > '2019-03-14 00:28:45.761190') GROUP BY simple_hashtag_hashtags.id ORDER BY COUNT(*) DESC LIMIT $1  [["LIMIT", 20]]
  NotifyFollower Load (0.0ms)  SELECT  "notify_followers".* FROM "notify_followers" WHERE (created_at > '2019-03-15 00:28:35.759191') AND 1=0 LIMIT $1  [["LIMIT", 1]]
  Rendered collection of templates [0 times] (0.0ms)
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
DEPRECATION WARNING: Setting custom parent classes is deprecated and will be removed in future versions. (called from parent_class_name at C:/Ruby24-x64/lib/ruby/gems/2.4.0/bundler/gems/acts_as_follower-c5ac7b9601c4/lib/acts_as_follower/follower_lib.rb:10)
  CACHE  (0.0ms)  SELECT COUNT(*) FROM "follows" WHERE "follows"."blocked" = $1 AND "follows"."follower_id" = $2 AND "follows"."follower_type" = $3  [["blocked", false], ["follower_id", 1], ["follower_type", "User"]]
  CACHE  (0.0ms)  SELECT COUNT(*) FROM "follows" WHERE "follows"."followable_id" = $1 AND "follows"."followable_type" = $2 AND "follows"."blocked" = $3  [["followable_id", 1], ["followable_type", "User"], ["blocked", false]]
  CACHE  (0.0ms)  SELECT COUNT(*) FROM "posts" WHERE "posts"."user_id" = $1  [["user_id", 1]]
   (0.0ms)  SELECT SUM("posts"."cached_votes_total") FROM "posts" WHERE "posts"."user_id" = $1  [["user_id", 1]]
  Rendered posts/_form.html.erb (285.8ms)
  Post Load (1.0ms)  SELECT  "posts".* FROM "posts" WHERE "posts"."user_id" = $1 ORDER BY created_at DESC LIMIT $2 OFFSET $3  [["user_id", 1], ["LIMIT", 20], ["OFFSET", 0]]
  User Load (1.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (0.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 33], ["votable_type", "Post"], ["vote_flag", true]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 33], ["votable_type", "Post"], ["vote_flag", false]]
   (2.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 33], ["commentable_type", "Post"]]
  Post Exists (0.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 33], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 33], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (76.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 32], ["votable_type", "Post"], ["vote_flag", true]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 32], ["votable_type", "Post"], ["vote_flag", false]]
   (1.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 32], ["commentable_type", "Post"]]
  Post Exists (1.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 32], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 32], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (68.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 31], ["votable_type", "Post"], ["vote_flag", true]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 31], ["votable_type", "Post"], ["vote_flag", false]]
   (1.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 31], ["commentable_type", "Post"]]
  Post Exists (1.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 31], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 31], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (52.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 30], ["votable_type", "Post"], ["vote_flag", true]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 30], ["votable_type", "Post"], ["vote_flag", false]]
   (1.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 30], ["commentable_type", "Post"]]
  Post Exists (1.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 30], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 30], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (45.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 29], ["votable_type", "Post"], ["vote_flag", true]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 29], ["votable_type", "Post"], ["vote_flag", false]]
   (0.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 29], ["commentable_type", "Post"]]
  Post Exists (0.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 29], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 29], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (44.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 28], ["votable_type", "Post"], ["vote_flag", true]]
   (0.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 28], ["votable_type", "Post"], ["vote_flag", false]]
   (0.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 28], ["commentable_type", "Post"]]
  Post Exists (1.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 28], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 28], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (42.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 27], ["votable_type", "Post"], ["vote_flag", true]]
   (0.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 27], ["votable_type", "Post"], ["vote_flag", false]]
   (1.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 27], ["commentable_type", "Post"]]
  Post Exists (1.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 27], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 27], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (71.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 26], ["votable_type", "Post"], ["vote_flag", true]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 26], ["votable_type", "Post"], ["vote_flag", false]]
   (1.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 26], ["commentable_type", "Post"]]
  Post Exists (1.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 26], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 26], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (42.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 25], ["votable_type", "Post"], ["vote_flag", true]]
   (0.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 25], ["votable_type", "Post"], ["vote_flag", false]]
   (0.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 25], ["commentable_type", "Post"]]
  Post Exists (1.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 25], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 25], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (109.9ms)
  User Load (1.0ms)  SELECT  "users".* FROM "users" WHERE (users.id != 1) AND 1=1 ORDER BY RANDOM() LIMIT $1  [["LIMIT", 4]]
  Rendered hashtags/_trending_hashtags_list.html.erb (73.0ms)
  Rendered mobile_search/_mobile_search_form.html.erb (1.0ms)
  Rendered posts/index.html.erb within layouts/application (3362.0ms)
Started GET "/new_notification_check.json" for 127.0.0.1 at 2019-03-14 20:28:54 -0400
Processing by NotificationsController#check_for_new_notifications as JSON
  User Load (2.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", 1], ["LIMIT", 1]]
  Rendering notifications/check_for_new_notifications.json.jbuilder
  Notification Load (1.0ms)  SELECT "notifications".* FROM "notifications" WHERE "notifications"."recipient_id" = $1 AND "notifications"."read_at" IS NULL  [["recipient_id", 1]]
  Rendered notifications/check_for_new_notifications.json.jbuilder (2.0ms)
Completed 200 OK in 5142ms (Views: 4933.4ms | ActiveRecord: 3.0ms)


Started GET "/new_notification_check.json" for 127.0.0.1 at 2019-03-14 20:29:11 -0400
Processing by NotificationsController#check_for_new_notifications as JSON
  User Load (1.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", 1], ["LIMIT", 1]]
  Rendering notifications/check_for_new_notifications.json.jbuilder
  Notification Load (1.0ms)  SELECT "notifications".* FROM "notifications" WHERE "notifications"."recipient_id" = $1 AND "notifications"."read_at" IS NULL  [["recipient_id", 1]]
  Rendered notifications/check_for_new_notifications.json.jbuilder (3.0ms)
Completed 200 OK in 5234ms (Views: 5034.3ms | ActiveRecord: 2.0ms)


   (1.0ms)  SELECT COUNT(*) FROM (SELECT DISTINCT "mailboxer_conversations".* FROM "mailboxer_conversations" INNER JOIN "mailboxer_notifications" ON "mailboxer_notifications"."conversation_id" = "mailboxer_conversations"."id" AND "mailboxer_notifications"."type" IN ('Mailboxer::Message') INNER JOIN "mailboxer_receipts" ON "mailboxer_receipts"."notification_id" = "mailboxer_notifications"."id" WHERE "mailboxer_notifications"."type" = $1 AND "mailboxer_receipts"."mailbox_type" = $2 AND "mailboxer_receipts"."trashed" = $3 AND "mailboxer_receipts"."deleted" = $4 AND "mailboxer_notifications"."type" = $5 AND "mailboxer_receipts"."receiver_id" = $6 AND "mailboxer_receipts"."receiver_type" = $7 AND "mailboxer_receipts"."is_read" = $8 ORDER BY "mailboxer_conversations"."updated_at" DESC) subquery_for_count  [["type", "Mailboxer::Message"], ["mailbox_type", "inbox"], ["trashed", false], ["deleted", false], ["type", "Mailboxer::Message"], ["receiver_id", 1], ["receiver_type", "User"], ["is_read", false]]
  Rendering notifications/check_for_new_notifications.json.jbuilder
  Rendered notifications/check_for_new_notifications.json.jbuilder (0.0ms)
  Rendered nav_partials/_user_navbar.html.erb (779.8ms)
  Rendered flash_messages/_messages.html.erb (1.0ms)
Completed 200 OK in 35067ms (Views: 34819.5ms | ActiveRecord: 48.0ms)


Finished "/cable/" [WebSocket] for 127.0.0.1 at 2019-03-14 20:29:20 -0400
PostChannel stopped streaming from post_channel
Started GET "/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaDFvUlZwaFVucG5WREUxWm1KRFZGcElRMUIxWkdOd01sZ0dPZ1pGVkE9PSIsImV4cCI6IjIwMTktMDMtMTVUMDA6MzA6MDguMzYwWiIsInB1ciI6ImJsb2Jfa2V5In19--91e7fc0892b936167864f6e83ae67ecf2a84f97e/user_thumb_default.png?content_type=image%2Fpng&disposition=inline%3B+filename%3D%22user_thumb_default.png%22%3B+filename%2A%3DUTF-8%27%27user_thumb_default.png" for 127.0.0.1 at 2019-03-14 20:29:21 -0400
Started GET "/posts" for 127.0.0.1 at 2019-03-14 20:29:23 -0400
Started GET "/cable" for 127.0.0.1 at 2019-03-14 20:29:23 -0400
Processing by ActiveStorage::DiskController#show as PNG
  Parameters: {"content_type"=>"image/png", "disposition"=>"inline; filename=\"user_thumb_default.png\"; filename*=UTF-8''user_thumb_default.png", "encoded_key"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaDFvUlZwaFVucG5WREUxWm1KRFZGcElRMUIxWkdOd01sZ0dPZ1pGVkE9PSIsImV4cCI6IjIwMTktMDMtMTVUMDA6MzA6MDguMzYwWiIsInB1ciI6ImJsb2Jfa2V5In19--91e7fc0892b936167864f6e83ae67ecf2a84f97e", "filename"=>"user_thumb_default"}
Started GET "/cable/" [WebSocket] for 127.0.0.1 at 2019-03-14 20:29:27 -0400
Processing by PostsController#index as HTML
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
  Disk Storage (33.0ms) Downloaded file from key: hEZaRzgT15fbCTZHCPudcp2X
  User Load (4.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", 1], ["LIMIT", 1]]
  Rendering text template
DEPRECATION WARNING: Setting custom parent classes is deprecated and will be removed in future versions. (called from parent_class_name at C:/Ruby24-x64/lib/ruby/gems/2.4.0/bundler/gems/acts_as_follower-c5ac7b9601c4/lib/acts_as_follower/follower_lib.rb:10)
  Rendered text template (0.0ms)
  User Load (3.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
Sent data  (14.0ms)
Registered connection (Z2lkOi8vcmVzdW1lLWZ1dHVyZS1hcHAvVXNlci8x)
Completed 200 OK in 70ms (Views: 13.0ms | ActiveRecord: 0.0ms)


   (7.0ms)  SELECT "users"."id" FROM "users" INNER JOIN "follows" ON "follows"."followable_id" = "users"."id" AND "follows"."followable_type" = $1 WHERE "follows"."blocked" = $2 AND "follows"."follower_id" = $3 AND "follows"."follower_type" = $4 AND "follows"."followable_type" = $5  [["followable_type", "User"], ["blocked", false], ["follower_id", 1], ["follower_type", "User"], ["followable_type", "User"]]
  UserProfile Load (10.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
PostChannel is transmitting the subscription confirmation
PostChannel is streaming from post_channel
  Post Load (11.0ms)  SELECT  "posts".* FROM "posts" LEFT OUTER JOIN "active_storage_attachments" ON "active_storage_attachments"."record_id" = "posts"."id" AND "active_storage_attachments"."record_type" = $1 AND "active_storage_attachments"."name" = $2 WHERE "posts"."user_id" = $3 GROUP BY "posts"."id" HAVING (COUNT(active_storage_attachments) >= 1) ORDER BY "posts"."id" DESC LIMIT $4  [["record_type", "Post"], ["name", "insight_photo"], ["user_id", 1], ["LIMIT", 4]]
DEPRECATION WARNING: Setting custom parent classes is deprecated and will be removed in future versions. (called from parent_class_name at C:/Ruby24-x64/lib/ruby/gems/2.4.0/bundler/gems/acts_as_follower-c5ac7b9601c4/lib/acts_as_follower/follower_lib.rb:10)
  CACHE  (0.0ms)  SELECT "users"."id" FROM "users" INNER JOIN "follows" ON "follows"."followable_id" = "users"."id" AND "follows"."followable_type" = $1 WHERE "follows"."blocked" = $2 AND "follows"."follower_id" = $3 AND "follows"."follower_type" = $4 AND "follows"."followable_type" = $5  [["followable_type", "User"], ["blocked", false], ["follower_id", 1], ["follower_type", "User"], ["followable_type", "User"]]
DEPRECATION WARNING: Setting custom parent classes is deprecated and will be removed in future versions. (called from parent_class_name at C:/Ruby24-x64/lib/ruby/gems/2.4.0/bundler/gems/acts_as_follower-c5ac7b9601c4/lib/acts_as_follower/follower_lib.rb:10)
  CACHE  (0.0ms)  SELECT "users"."id" FROM "users" INNER JOIN "follows" ON "follows"."followable_id" = "users"."id" AND "follows"."followable_type" = $1 WHERE "follows"."blocked" = $2 AND "follows"."follower_id" = $3 AND "follows"."follower_type" = $4 AND "follows"."followable_type" = $5  [["followable_type", "User"], ["blocked", false], ["follower_id", 1], ["follower_type", "User"], ["followable_type", "User"]]
Started GET "/new_notification_check.json" for 127.0.0.1 at 2019-03-14 20:29:29 -0400
  Rendering posts/index.html.erb within layouts/application
DEPRECATION WARNING: Setting custom parent classes is deprecated and will be removed in future versions. (called from parent_class_name at C:/Ruby24-x64/lib/ruby/gems/2.4.0/bundler/gems/acts_as_follower-c5ac7b9601c4/lib/acts_as_follower/follower_lib.rb:10)
   (55.0ms)  SELECT COUNT(*) FROM "follows" WHERE "follows"."blocked" = $1 AND "follows"."follower_id" = $2 AND "follows"."follower_type" = $3  [["blocked", false], ["follower_id", 1], ["follower_type", "User"]]
   (34.0ms)  SELECT COUNT(*) FROM "follows" WHERE "follows"."followable_id" = $1 AND "follows"."followable_type" = $2 AND "follows"."blocked" = $3  [["followable_id", 1], ["followable_type", "User"], ["blocked", false]]
Processing by NotificationsController#check_for_new_notifications as JSON
   (2.0ms)  SELECT COUNT(*) FROM "posts" WHERE "posts"."user_id" = $1  [["user_id", 1]]
  User Load (2.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", 1], ["LIMIT", 1]]
  SimpleHashtag::Hashtag Load (173.9ms)  SELECT  "simple_hashtag_hashtags".* FROM "simple_hashtag_hashtags" LEFT OUTER JOIN "simple_hashtag_hashtaggings" ON "simple_hashtag_hashtaggings"."hashtag_id" = "simple_hashtag_hashtags"."id" WHERE (simple_hashtag_hashtaggings.created_at > '2019-03-14 00:29:28.002495') GROUP BY simple_hashtag_hashtags.id ORDER BY COUNT(*) DESC LIMIT $1  [["LIMIT", 20]]
  NotifyFollower Load (183.9ms)  SELECT  "notify_followers".* FROM "notify_followers" WHERE (created_at > '2019-03-15 00:29:17.994502') AND 1=0 LIMIT $1  [["LIMIT", 1]]
  Rendered collection of templates [0 times] (0.0ms)
  ActiveStorage::Attachment Load (1134.3ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  ActiveStorage::Blob Load (1196.3ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
  CACHE  (0.0ms)  SELECT COUNT(*) FROM "follows" WHERE "follows"."blocked" = $1 AND "follows"."follower_id" = $2 AND "follows"."follower_type" = $3  [["blocked", false], ["follower_id", 1], ["follower_type", "User"]]
  Notification Load (2.0ms)  SELECT "notifications".* FROM "notifications" WHERE "notifications"."recipient_id" = $1 AND "notifications"."read_at" IS NULL  [["recipient_id", 1]]
  CACHE  (0.0ms)  SELECT COUNT(*) FROM "follows" WHERE "follows"."followable_id" = $1 AND "follows"."followable_type" = $2 AND "follows"."blocked" = $3  [["followable_id", 1], ["followable_type", "User"], ["blocked", false]]
  Rendered notifications/check_for_new_notifications.json.jbuilder (6.0ms)
Completed 200 OK in 5177ms (Views: 4995.3ms | ActiveRecord: 4.0ms)


  CACHE  (0.0ms)  SELECT COUNT(*) FROM "posts" WHERE "posts"."user_id" = $1  [["user_id", 1]]
   (1.0ms)  SELECT SUM("posts"."cached_votes_total") FROM "posts" WHERE "posts"."user_id" = $1  [["user_id", 1]]
  Rendered posts/_form.html.erb (290.8ms)
  Post Load (1.0ms)  SELECT  "posts".* FROM "posts" WHERE "posts"."user_id" = $1 ORDER BY created_at DESC LIMIT $2 OFFSET $3  [["user_id", 1], ["LIMIT", 20], ["OFFSET", 0]]
  User Load (1.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 33], ["votable_type", "Post"], ["vote_flag", true]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 33], ["votable_type", "Post"], ["vote_flag", false]]
   (4.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 33], ["commentable_type", "Post"]]
  Post Exists (1.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 33], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 33], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (51.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (0.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 32], ["votable_type", "Post"], ["vote_flag", true]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 32], ["votable_type", "Post"], ["vote_flag", false]]
   (0.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 32], ["commentable_type", "Post"]]
  Post Exists (0.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 32], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 32], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (40.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (1.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 31], ["votable_type", "Post"], ["vote_flag", true]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 31], ["votable_type", "Post"], ["vote_flag", false]]
   (0.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 31], ["commentable_type", "Post"]]
  Post Exists (1.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 31], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 31], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (51.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 30], ["votable_type", "Post"], ["vote_flag", true]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 30], ["votable_type", "Post"], ["vote_flag", false]]
   (1.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 30], ["commentable_type", "Post"]]
  Post Exists (1.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 30], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 30], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (45.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 29], ["votable_type", "Post"], ["vote_flag", true]]
   (0.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 29], ["votable_type", "Post"], ["vote_flag", false]]
   (0.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 29], ["commentable_type", "Post"]]
  Post Exists (1.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 29], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 29], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (77.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 28], ["votable_type", "Post"], ["vote_flag", true]]
   (0.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 28], ["votable_type", "Post"], ["vote_flag", false]]
   (1.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 28], ["commentable_type", "Post"]]
  Post Exists (0.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 28], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 28], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (42.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 27], ["votable_type", "Post"], ["vote_flag", true]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 27], ["votable_type", "Post"], ["vote_flag", false]]
   (0.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 27], ["commentable_type", "Post"]]
  Post Exists (1.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 27], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 27], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (44.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (0.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 26], ["votable_type", "Post"], ["vote_flag", true]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 26], ["votable_type", "Post"], ["vote_flag", false]]
   (1.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 26], ["commentable_type", "Post"]]
  Post Exists (1.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 26], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 26], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (44.0ms)
  CACHE User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT  "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 1], ["LIMIT", 1]]
  CACHE ActiveStorage::Attachment Load (0.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 2], ["record_type", "UserProfile"], ["name", "avatar"], ["LIMIT", 1]]
  CACHE ActiveStorage::Blob Load (0.0ms)  SELECT  "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2  [["id", 12], ["LIMIT", 1]]
   (1.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 25], ["votable_type", "Post"], ["vote_flag", true]]
   (0.0ms)  SELECT COUNT(*) FROM "votes" WHERE "votes"."votable_id" = $1 AND "votes"."votable_type" = $2 AND "votes"."vote_flag" = $3  [["votable_id", 25], ["votable_type", "Post"], ["vote_flag", false]]
   (1.0ms)  SELECT COUNT(*) FROM "comments" WHERE "comments"."commentable_id" = $1 AND "comments"."commentable_type" = $2  [["commentable_id", 25], ["commentable_type", "Post"]]
  Post Exists (1.0ms)  SELECT  1 AS one FROM "posts" WHERE "posts"."user_id" = $1 AND "posts"."post_id" = $2 LIMIT $3  [["user_id", 1], ["post_id", 25], ["LIMIT", 1]]
  ActiveStorage::Attachment Load (1.0ms)  SELECT  "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4  [["record_id", 25], ["record_type", "Post"], ["name", "insight_photo"], ["LIMIT", 1]]
  Rendered posts/_post.html.erb (43.0ms)

@RailsCod3rFuture
Copy link
Author

I just need simple ajax functionality for images to work. I see that you can do it with the JS Direct Upload events. But, how would I implement it into my current solution?

@gmcgibbon
Copy link
Member

For usage questions, please refer to the mailing list or StackOverflow where a wider community can assist you. This also seems like it might be a problem related to the remotipart gem, which isn't maintained by rails. The issue tracker is reserved for bugs only. Thanks!

@ziaulrehman40
Copy link

I am also randomly facing this issue, some records save all fine some end up with this error.

My files are also being posted by AJAX request. Something is going on, any help with debugging will be great.

@ziaulrehman40
Copy link

ziaulrehman40 commented Jan 13, 2020

I think I found cause for our case, this issue can is occuring if your table PK type is not int/bigint, in our case that type is uuid, closer inspection seems to suggest that it kidn fo calls to_i on whatever the id type is(at-least thats the behavior for our uuid keys) for insertion in active_storage_attachments's record_id column.

Which works for some UUIDs and does not for other. Even when it works that;s not reliable.

There are issues like #35746 which can be of help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants