...we have to keep a long list of all the methods and update it whenever changes are made? Fortunately not, because there is a common pattern for this in Ruby...
...slow SQL queries, it’s helpful to understand the database engine's query plan. Whenever you execute a declarative SQL query, the database generates a "query plan" that outlines the...
...may conflict with that. Here are two solutions that allow you to keep pushing whenever you feel like it. Special commit message To skip a CI run, simply add [ci...
...pageview', { 'page': '/YOUR-CUSTOM-PATH' }); With Unpoly With Unpoly you want to trigger an Analytics pageview whenever a major content fragment is replaced. See Unpoly instructions here. Legacy snippet Change this:
...share a state in Ruby with global variables. Even if you should avoid them whenever possible, for debugging an application this could be temporary quite handy. Example: class User
when you use your class as hash keys or arrays override eql? whenever eql? is overridden, override hash accordingly Here is an example implementation for a basic class...
...care about the (longer) value and just stores the date part. This means that whenever you pass a time that is within X hours away from midnight (where X is...
...with a throttling mechanism. Touch events can still be cancelled, mark them as passive whenever you can! On Chrome, touchstart and touchmove is passive by default Because of the slow...
...iterates over all cleaners and executes your statement for each of them. This means whenever you use this direct call in your code, you actually perform this on a list...
Be careful not to accidentally call any method directly on the DatabaseCleaner module whenever you want to specify different configurations for multiple databases. This will overwrite any individual configuration...
Whenever you create a table from a database migration, remember to add updated_at and created_at timestamps to that table. Without those timestamps, investigating future bug reports will be...
...the Module class. This method can be overwritten for module instances and is called whenever the module is included somewhere: module Greet def self.included(base) puts "Greet is included into...
...but you need to call regularly from your preferred scheduler. For example, when using whenever, you should have something like this in your schedule.rb: every :day, at: '05:00', roles...
...from summertime to wintertime in different locations, etc.). Try to avoid using time zones whenever possible. When you want to only deal with day times, the handy gem Tod (Time...
...no separate build process in development. Instead the Rails server directly compiles the asset whenever it renders a javascript_tag, stylesheet_tag or image_tag. It still has issues on...
...scripts (I use ~/bin/update-chromedriver) and give execute permissions (e.g. via chmod +x ~/bin/update-chromedriver). Then, whenever your Chrome is updated, run update-chromedriver and after one second you are ready to...
...examples with your expectations & implement them. Do so in whatever order works for you. Whenever you notice a new requirement, add it as a new scenario or example. While following...
...your mentor is both your code reviewer and your customer. Ping them in Slack whenever you think it's their turn in the process. For all further lessons, you should...
...the PDFKit middleware on your development, you might experience that your application "locks up" whenever you request a .pdf route. This behavior is caused by a deadlock: The Rails process...
...RSS gem for the purpose of this card. Update it once a day (using whenever) Tip Consider the best place to put the new logic. Should it be an existing...
SVG is an acronym for "scalable vector graphics". SVGs should be used whenever an image can be described with vector instructions like "draw a line there" or "fill that space...
...not implement sending a welcome e-mail, send an e-mail now. In MovieDB, whenever someone creates a movie, send a notification to moviedb-admin@example.com. Can you attach the movie's...
Background Ubuntu always sets the primary display to the 1st (i.e. internal) display whenever I connect to a new Dock/Hub. I want my primary display to be the large...
Best solution: overflow: hidden This is the only reliably working property, use it whenever you can. Caution: This will literally cut off any content that leaves the container. You...
...by RSpec anymore as can be read in the documentation link above. Model specs Whenever you have to use the same cookie dependent logic between controllers and some controller helpers...