Newer versions of Bundler (at least since 2.3) have two different behaviors: If your Gemfile.lock reads PLATFORMS: ruby, it might either install a compatible platform-specific version...

...or similar), bundler will install exactly the versions indiciated in the Gemfile.lock. Fix For better consistency, I would advise to make sure you always have PLATFORMS x86_64-linux

For searching in large database tables we usually use PostgreSQL's fulltext search capabilities. While this works reasonably well for...

Since Rails 7 you are able to encrypt database information with Active Record. Using Active Record Encryption will store an...

github.com

...multiple subsequent occurrences of a given character with a single one Use Tap For Better Test Data Setup let(:order) do create(:order, name: "My Order").tap do |order|

When changing glibc versions, it's possible to end up with corrupt indexes in PostgreSQL. Are My Indexes Affected?

We are using the BEM pattern ("Block, Element, Modifier") to structure our CSS in all new projects. We try to migrate legacy projects to BEM, block-by-block. Read

...it important modifiers start with -? More examples Look at some examples of a good BEM structure in the DOM tree of these websites: https://makandra.de/ https://railslts.com/ https://www.aitiraum.de/

...Just take a step back and evaluate its usefulness first. Also, consider if its benefits outweigh the cost of teaching and maintaining the new thing. Being a good open-source...

makandra dev
api.rubyonrails.org

ActiveModel supplies an errors object that behaves similar to a Hash. It can be used to add errors to a record, as well as to query the record for registered...

Redis.current will be removed without replacement in redis-rb 5.0. Version 4.6.0 adds deprecation warnings for Redis.current and Redis.current=: `Redis.current...

...least modularity 3.1.0. Compare implementations Now compare your implementations. Which one do you like best? Does modularity offer features the other approaches don't...

...until we know for sure which image version we will need and the solution becomes very simple. Here is a small helper function for your mailer views: def inline!(version...

tl;dr Individual transform properties are great because they allow you to write more readable and maintainable CSS, especially when...

...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 class or new classes...

...plain RSpec mocks ("stubs") to replace the HTTP request to the API with scripted behavior. Can you minimize the number of lines of code that now no longer run during...

ruby-lang.org

Ruby 3.0 introduced a breaking change in how it treats keyword arguments. There is an excellent blog post on the...

JavaScript is a scripting language supported by all browsers. Browsers don't speak Ruby, so if we want to implement...

regular-expressions.info

Look-arounds provide a way to match context-dependant. You can look-behind, look-ahead and to both in a positive and negative way. The look-around will...

...Modifiers in Ruby Add modifiers after the final slash, e.g. /Regex/im, or at the beginning of the regex, e.g. /(?i)regex/. i: case insensitivity m: make the .-character also match...

makandra Curriculum

Watch Solving bizarre authorization requirements with Rails Read the Consul README Read the assignable_values README Understand how Consul...

We had a card that described how to install multiple mysql versions using mysql-sandbox. Nowadays with the wide adoption...

Programatically invoke Rails generators Require the generator, instantiate it and invoke it (because generators are Thor::Groups, you need...

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...

...way to calculate the signature is to use an HMAC. Unfortunately, I don't believe you can calculate a proper HMAC in a regular Apache installation. Instead, we do something...

2013-02-20 (Tobias) ... with exactly the following rows 2012-06-20 (Henning) Better normalization (more consistent for expected/real input, gets rid of nbsps) 2012-06-01 (Tobias)

...wildcard support (partial matches) 2012-05-25 (Tobias) Better error output; "should not see" now fails if any of the rows is present; cells are now matched exactly, wildcard for...

...NonExistentClass".constantize # => NameError: uninitialized constant NonExistentClass Dynamic Programming In scenarios where your application’s behavior depends on dynamic constant resolution, safe_constantize may offer a more convenient control flow to...

DirectUpload allows you to upload files to your file storage without having to wait for the form to submit. It...