...On the database level, you will see these queries (simplified; the number at the beginning of each line is the connection ID): 1 Connect 1 BEGIN 1 INSERT INTO foos...
...you might be doing stuff afterwards that could require to abort the transaction). A better approach As a general rule, never use ActiveRecord::Base.establish_connection and also don't use...
By default, Devise redirects to a sign-in form when accessing a route that requires authentication. If for some reason...
You are getting when connecting via SSH or deploying with Capistrano (which uses SSH): Too many authentication failures for username...
Capybara gives you two different methods for executing Javascript: page.evaluate_script("$('input').focus()") page.execute_script("$('input').focus()")
After upgrading to Rails 6.1.7.2 one of our apps printed a wall of warnings while booting: /var/www/app/shared/bundle/ruby/2.6.0/gems/net-protocol-0.2.1/lib/net/protocol.rb:68: warning: already...
Instead of running all missing migrations on your test database with rake db:migrate RAILS_ENV=test you can also...
We forked trusty memoizer to make two changes: Memoized methods now preserve their arity. Previously all memoized methods had an...
...Safari, ...) or Firefox, this is only the initial size -- users can resize textareas to become bigger. This is helpful to the user, but may be breaking your application layout in...
This note describes a Cucumber step definition that lets you say: Then "Mow lawn" should be an option for "Activity...
...iterated until the final design is ready – shiny, accepted and ready for implementation. I believe this works well when you get to work with the final decider in person.
As attachments to this card you will find a Cucumber feature and supplementing step definition that you can use to...
I had a huge MySQL dump that took forever (as in: days) to import, while I actually just wanted to...
We recently decided to put static content for HouseTrip.com to Amazon Cloudfront for a faster user experience. This happens fully...
Do all of the above, and also Remove all blocks and hooks belonging to craken from your config/deploy.rb. Delete vendor/plugins/craken. Check if you have lib/tasks/craken.rb. If so, delete...
The Rails asset pipeline improves delivery of application assets (javascripts, stylesheets, images, fonts). Here are some basic facts about its...
...switches to the clicked link. In a Jasmine spec I wanted to test this behaviour. Unpoly's up.hello emits an up:fragment:inserted event, in whose callback function I can...
When using the asset pipeline your assets (images, javascripts, stylesheets, fonts) live in folders inside app: app/assets/fonts app/assets/images...
...export_path = Dir.mktmpdir('exports') # ... ensure FileUtils.remove_entry(export_path) end Option 3: Using a before/after block before { @export_path = Dir.mktmpdir('exports') } after do if @export_path.present? FileUtils.remove_entry(@export_path)
ActiveRecord provides the ids method to pluck ids from a scope, but what if you need to pluck Global IDs...
The linked article explains how to get a database-wide lock without creating table rows: This article explains how I...
When logging in Rails, you can use the log_tags configuration option to add extra information to each line, like...
In production, you (or your ops team) should configure a maximum number of bytes that Redis can use to store...
...per group but only one value can be picked for the results. The default behaviour of MySQL prior to version 5.7 will not complain and arbitrarily choose a value. But...
Inspired by recent "git shortcut" cards I figured it would be nice to have one of these for rebasing a...