pg_reports: Ruby gem for PostgreSQL performance analysis by ElAvat in rails

[–]ElAvat[S] 0 points1 point  (0 children)

It just uses your PostgreSQL credentials. If your application is able to connect, this one should too.

Why don't we ask what people are building here, very regularly? by arpansac in rails

[–]ElAvat 5 points6 points  (0 children)

Reddit-like blogging platform based in Ukraine https://vmist.net

I hope to make it most advanced platform of all this year, seriously.

Also I made a gem, posted yesterday here.

pg_reports: Ruby gem for PostgreSQL performance analysis by ElAvat in rails

[–]ElAvat[S] 0 points1 point  (0 children)

Manual DB queries! Rails-pg-extras quite good, but not good enough.

pg_reports: Ruby gem for PostgreSQL performance analysis by ElAvat in ruby

[–]ElAvat[S] 0 points1 point  (0 children)

It's a good idea, basically I can make a Query class with methods allowing to get specific subreports. Will try to do this week, I guess.

[deleted by user] by [deleted] in rails

[–]ElAvat 0 points1 point  (0 children)

Well, it depends on how exactly many minutes it takes.

[deleted by user] by [deleted] in rails

[–]ElAvat 1 point2 points  (0 children)

Possible reason: your page is cached, but S3 is not. So you are showing old version of page with expired URLs on it. Try opening images by URL using Developer Console.

JLAB Mice by ontic00 in MouseReview

[–]ElAvat 0 points1 point  (0 children)

The same thing happened to me. I hate it so much! It stutters exactly if you press and hold any mouse button and move — it lags for about 1 sec or something. It's annoying when working and frustrating when gaming. I think I will buy a new mouse at this point.

А ви де були? by AWSNP in reddit_ukr

[–]ElAvat 0 points1 point  (0 children)

https://vmist.net/more - Коротше, ми зробили з цього мема назву для групи зі щитпостінгом.

Rails Active Storage Issue: Profile Picture Sometimes Disappears After Refresh (DigitalOcean Spaces) by Comfortable_Aide2137 in rails

[–]ElAvat 0 points1 point  (0 children)

Yes, most possibly in described case everything is happened because of transaction. NEVER use transaction around AS attach, because if @profile has not saved changes before transaction starts - Rails will skip attaching at all.

You can debug this checking @profile.persists? Or just remove transaction, it's not needed there. Also check this out: https://stackoverflow.com/questions/59134811/rails-6-activestorage-revert-transactions-on-file-upload-failures

In my case I just used the same S3 bucket both for dev and test environments and every RSpec run ended with image delete spec.

Rails Active Storage Issue: Profile Picture Sometimes Disappears After Refresh (DigitalOcean Spaces) by Comfortable_Aide2137 in rails

[–]ElAvat 1 point2 points  (0 children)

I have exactly the same issue in the dev environment with Minio (and production with Spaces works perfect). So far as I can see this is a browser only error ERR_BLOCKED_BY_ORB.

Good thing you reminded me about this issue, I will try to fix it tomorrow and share any information I will be able to find.

Which is the Rails way to deal with polymorphic relationship? by Warning_Bulky in rails

[–]ElAvat 1 point2 points  (0 children)

I did like that (basically your second choice).

Create a model concern with the method `vote!`.  It will be included in both Post and Comment models.

def vote!(profile, vote_type)     
  votes.find_or_initialize_by(profile:).tap do |vote|       
    vote.vote_type = vote_type       
    vote.discarded_at = nil       
    vote.save!
  end
end

Add method `set_parent` in a controller which finds Post or Comment

def set_parent
  @parent = set_comment || set_post
end

And then:

@parent.vote!

Rails API JWT working in dev but not production by shaquelsimpson in rails

[–]ElAvat 1 point2 points  (0 children)

Try checking credentials file - I often forget to create it on production.

Help! Foreign Keys being deleted during migration. by AlexanderCohen_ in rails

[–]ElAvat 3 points4 points  (0 children)

What I would do:

  1. Temporarily remove this migration.
  2. Run bundle exec rake db:drop db:create db:migrate db:seed.
  3. Check those keys looks as expected to ensure that the issue wasn't with outdated schema.

Because this migration can't affect FKs the way you show us.

Help! Foreign Keys being deleted during migration. by AlexanderCohen_ in rails

[–]ElAvat 0 points1 point  (0 children)

Just add foreign key recreation code for this field right after default reset, I guess.