Learn how to set up a one-to-many or many-to-many association which is entirely embedded into a...
Another replacement for factories and fixtures that focuses on being DRY and making developers type as little as possible.
Template inliner avoids the problem when to render a large list of objects,
this is a very cool lib,
Fuck acronyms, really
An ActionMailer delivery method to save mails as files in a directory.
So you downloaded inaction_mailer, and you had a folder full of e-mails generated while writing your app?
Easily show multiple, overlapping events across calendar days and rows.
A simple implementation of an Identity Mapper for Active Record.
Unfortunately vanilla Ruby modules lack support for many idioms popular in modern Ruby. Most importantly, we have become accustomed to...
Steak is like Cucumber but in plain Ruby.
Rack middleware for rate-limiting incoming HTTP requests.
File upload solution that supports form roundtrips when a validation fails.
Here is a set of additive color model conversion algorithms that I found published on Wikipedia and have implemented in...
We recently decided our CI server needed an overhaul. I really enjoyed Integrity as a build server, but after trying...
What do we expect from the custom finder? We expect that it should find assets A, B, C and should...
All ActiveRecord associations except for has_many :through support callbacks for pre- and post-insertion/deletion via the following, self...
...and decide if any of it needs an update. Your main components (e.g. Ruby, Rails, Unpoly) should always be reasonably up to date. Keeping your dependencies up-to-date is...
...a lib/ext/super_client.rb to your project (see How to organize monkey patches in Ruby on Rails projects) Add the extension, which overrides both methods (prepend is available since Ruby >=2) # lib/ext/super_client.rb...
...can define the vcr: true hook yourself: # spec/support/vcr.rb VCR.configure do |c| c.cassette_library_dir = Rails.root.join("spec", "vcr") c.hook_into :webmock end RSpec.configure do |c| c.around(:each, :vcr) do |example|
...users.map { |user| [user.id, user.name] }.to_h { 1 => "Alice", 2 => "Bob" } Enumerable#index_by (any Rails version) users = User.all users_by_id = users.index_by(&:id) { 1 => #<User id: 1, name: "Alice...
...User id: 1, name: "Alice">], "Bob" => [#<User id: 2, name: "Bob">] } Enumerable#index_with (Rails 6+) To generate a hash where array elements become hash keys, and values are calculated...
job_id: job.job_id, executions: job.executions, queue_name: job.queue_name, url: url, }, ) end Rails.application.configure do # Also capture errors not handled by Active Job config.good_job.on_thread_error = ExceptionNotifier.method(:notify_exception...
In medium-sized to large Rails applications, asset compilation can take several minutes. In order to speed up deployment, asset precompilation can be skipped. This card automates the process.
...mind that you may need to migrate your database as Git is unaware of Rails and will not cast any magic. If Git checked out a commit that is working...