David Kimura PRO
Joined 7/18/2015
Drifting Ruby Owner
David Kimura PRO said almost 2 years ago on Campfire Deploy with Kamal :
  hugo.kindel It's a good idea to have the services on different Redis databases. However, keep in mind that Redis does not support different configurations for the databases (volatile vs nonvolatile) as you would need different Redis services for each type.

David Kimura PRO said almost 2 years ago :
You could try to create a .keep file in the tmp folder. Make sure your .dockerignore isn't excluding the tmp folder.

Something like this is in the Rails main's .dockerignore.

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

David Kimura PRO said almost 2 years ago :
Ah, the /tmp it is referring to may be the system tmp folder. You may want to see if you can create the tempfile within your Rails folder's tmp. My thought is that the dockerfile is changing the user and this user doesn't have access to write there.

David Kimura PRO said almost 2 years ago on Soft Limits :
  torrentdu64 The limit and offset is to grab the number of records to be "deactivated" 

limit = user.books.count - user.resource_limit
this is getting the total number of books and subtracting the soft limit that the user has set. So if there are 10 books and the user is allowed to have 4 then the limit will be set to 6. "limit" is probably a bad name because it really is number_of_books_over_the_limit.

The limit method will only return that number of books (performing a SQL LIMIT) whereas offset will return all of the records, offsetting from whatever number it is.So, in this case, we deactivated the records up to 6, but then activated the rest of them (offsetting from 6), so that should be the 4 allowed records within the soft limits implementation.

David Kimura PRO said almost 2 years ago on Soft Limits :
  lrjbrual I would have a look at the webhooks implementation in this episode https://www.driftingruby.com/episodes/webhooks-from-stripe-billing-portal. Whenever there is a change plan or charge succeeded event, I would simply look up their subscription and then call the update to the user's resource limit and the updating of the resources.