Added: State machine can now use the :prefix-option to avoid name collision if you define multiple state machines on...

If you want to move a complete commit from one repository to another (and you don't want to add...

Partials always define a local variable with the same name as themselves. E.g. when you are in _recent_users.html.erb, a local...

github.com

When a method has keyword arguments, Ruby offers implicit conversion of a Hash argument into keyword arguments. This conversion is...

github.com

Zeitwerk is the new autoloader of Rails. It is mandatory starting with Rails 7.0. Sometimes, a model needs to know...

Attention This is an edge-case. You probably don't want to mix different database dumps. It also requires that...

Controllers Take care when defining nested resources, as they don't behave identical to namespaced resources: namespace :users do resources :sign_ups, only: [:new] end # GET /users/sign_ups/new...

...in controllers/sign_ups_controller.rb in order to make the second example work. You can alter this behaviour with a custom controller path, as shown in the very first example of this card...

...to work as expected Good Then the crontab -l output will look like this: # Begin Whenever generated tasks for: some-app_staging 34 23 * * * /bin/bash -l -c 'cd /var/www/some-app_staging/releases/20201215171150 && RAILS...

...value, that can not be replaced by Whenever (the release folder changes every deploy): # Begin Whenever generated tasks for: /var/www/some-app_staging/releases/20201215171150 34 23 * * * /bin/bash -l -c 'cd /var/www/some-app_staging/releases/20201215171150 && RAILS_ENV=staging...

...applications with forms (warp_params will do that for you). But maybe its a better idea to stick to a standard that client libraries know to handle. Tests

...really nice and we implemented it in a similar way like here. In the beginning we tried to remove any duplicated in the schema files. So when a booking had...

...also packaged as a snap. A snap will always track a channel (like stable, beta) and automatically update to the newest version available in this channel. By default the snap...

channels: stable: 2018.3.2 (72) 269MB classic candidate: 2018.3.2 (72) 269MB classic beta: 2018.3.2 (72) 269MB classic edge: 2018.3.2 (72) 269MB classic 2018.3/stable: 2018.3.2 (72) 269MB classic 2018.3/candidate...

If you want to see how long your database queries actually take, you need to disable MySQL's query cache...

This should not be necessary in any case and is only for special cases, for e.g. if the assets...

=> >> response.code => 422 FYI, the http gem is a great alternative to RestClient which behaves like that by default and has a well-designed API in general (much better than...

In case you want to use pry with an older version of Ruby, you can try the following configurations.

Imagine you want to write a cucumber test for a user-to-user chat. To do this, you need the...

makandra dev

...its version number, it is considered a pre-release: 1.0.0.rc1 2.3.0.alpha2 3.0.0.beta3 4.0.0.pre.rc2 Even if a pre-release gem has the highest version number, it is...

...Semantic versioning Converted RubyGems version 1.0.0-rc1 1.0.0.pre.rc1 2.3.0-alpha2 2.3.0.pre.alpha2 3.0.0-beta3 3.0.0.pre.beta3 Note that npm packages force you to use Semantic Versioning's naming convention...

Intel CPUs receive updates, including security relevant upgrades, through 2 channels: Firmware/UEFI BIOS updates can also update the microcode in...

Usually you add errors to :base in ActiveRecord, in case no appropriate attribute could be used to add the error...

tl;dr: Avoid to memoize methods with default (keyword) arguments! When you are using Memoized with default arguments or default...

You can tell npm to install a package globally with npm -g install @puppeteer/browsers. However, it seems that its not...

Terraform (and terragrunt) gives a lot of output when running plan or apply, outputting a lot of progress information when...

sudo gem install gettext --no-ri --no-rdoc sudo gem install fast_gettext --no-ri --no-rdoc script/plugin install git://...

docs.ruby-lang.org

The sprintf method has a reference by name format option: sprintf("% d : % f", { :foo => 1, :bar => 2 }) # => 1 : 2.000000

Browsers blocks abusable JavaScript API calls until the user has interacted with the document. Examples would be opening new tab...