...have one of the following workflow states: draft pending published declined A movie always begins as a draft and then transitions through the states as it's getting reviewed. This...

Integration tests give the code its rough form, whereas unit tests pinpoint specific behavior. During development, you are frequently changing levels. It may look something like this: Integration _ ___

...usage example, "happy path"> # Add a scenario for each use case. Examples are: error behavior, access rights, contexts, closer looks at parts of the feature Scenario: ... (This example uses Cucumber...

When your controller action raises an unhandled exception, Rails will look at the exception's class and choose an appropriate...

Finding changes When you're looking for a specific change in Git, there are multiple axes you can choose:

Some pseudo-elements need to be addressed with vendor prefixes. E.g. ::selection is not supported by Firefox, you need to...

...set :bundle_without, %w[development test cucumber deploy].join(' ') Be aware, that gems that belong to two groups, are only excluded, when both of the groups are excluded, e.g. to...

w3.org

...bar"] (matches ) For the class attribute, this is the same as .bar. Match against beginning of value (CSS3) [foo^="bar"] (matches ) Note that matching a class is not as straight...

...since the class attribute usually contains several white-space separated values. To match the beginning of a class properly, use this combined selector: [class^="bar"], [class*=" bar"]. It matches bar...

ActiveModel classes have a class method .human_attribute_name. This returns a human-readable form of the attribute: Person.human_attribute...

stackoverflow.com

Important You should only implement an implicit conversion method if your object already behaves like the target type. You never create a new object in an implicit conversion method...

...either return self or not be implemented at all. Obviously, this is the reason behind this recent card about Ruby implicitly converting a hash to keyword arguments. It's not...

Developing or debugging SAML functionality can be a hassle, especially when you need to go back and forth with someone...

Short reference on how to quickly debug the vanilla Rails job adapters. Queue Adapters by Environment Environment Adapter

linux.die.net

You can convert git commits into patch files. Those can be used to apply to a different repository [1] or...

class User < ApplicationRecord has_one :session, dependent: :destroy end class Session < ApplicationRecord belongs_to :user end create_table :users do |t| t.timestamps end create_table :sessions do |t...

On the Rails console, assigning an object to a variable can lead to this strange error (without stacktrace): irb > recipient...

Performing COUNT(*) on large tables is slow. Sometimes you don’t need the exact number once results exceed a certain...

If you're using a Redis cache in Rails (e.g. :redis_cache_store), it's possible to configure additional parameters...

First find the reference for the entry you want through looking at the stash: $ git stash list stash@{0}: WIP...

This seems to be obvious, but you can expect Rake tasks to be called in RSpec. it 'deletes all Users...

github.com

When handling nested hashes the RSpec output is often hard to read. Here the gem super_diff could help.

...like using the /slackfont command. Fonts need to be installed on your machine. Webfonts beyond those provided by Slack won't magically work unless you install them locally.

...been tested manually by me adheres to the code style of the project (e.g. BEM) avoids "magic numbers" (don't say e.g. padding: 20px) does not duplicate existing styles (for...

Add screenshots of any new or changed elements. Gitlab has a "Details block" behind the "+" button in its WYSIWYG editor that helps saving space...

jQuery has a function $.fn.trigger(). You can use it to dispatch an event on a jQuery object: let $element = $('.foo...

github.com

ActiveType::Object inherits from ActiveRecod::Base and is designed to behave like an ActiveRecord Object, just without the database persistence. Don't remove any of the default behavior of...

...the window's resize event, that might call your event listener many times. A better way is to subscribe to changes of the MediaQueryList object that is returned by matchMedia...