PostgreSQL can cosplay as a full-text search engine. It doesn't have the features or fidelity of ElasticSearch or...
...fail with an SQL error due to duplicate index key. You can change Rails' behaviour, by saying class User < ActiveRecord::Base validates_uniqueness_of :name, case_sensitive: false end
In Ruby on Rails ActiveRecord::Relation#merge overwrites existing conditions on the same column. This may cause the relation to...
...default: 3.0.1) It is still possible to have newer version of a gem installed beside the default version: gem install strscan Fetching strscan-3.0.3.gem Building native extensions. This could take a...
...sends out transactional e-mails to a large number of users, e-mail deliverability becomes an issue. E-mail providers work hard to eliminate spam and have put in place...
...No staging sandbox No permission system for api keys No authentication mechanism for webhooks besides IP ranges Buggy admin UI SendGrid Pro: Very good deliverability Not quite as expensive
...will happen and will have effect. But what we can observe is that the behaviour of the callback function :my_method does not happen in the test, as if the...
...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.
...i.e. one transaction can see most of what another is doing), and SERIALIZABLE the best (i.e. transactions are very well isolated). Conversely, READ UNCOMMITTED gives you the best performance, while...
...will be the slowest, due to a lot of locking. This also affects locking behaviour and replication performance. The default level is REPEATABLE READ, and it's the mode you...
Due to network or hardware failures, it can happen that one of your cronjobs will not run at the time...
Say you wrap your index view in a form to apply different filters like pagination or a search query. On...
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...
...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|
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...
...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...
Ruby 3.0 introduced a breaking change in how it treats keyword arguments. There is an excellent blog post on the...
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...
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...
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...