In Rails 4.x we have transactional fixtures that wrap each test in a database transaction. This transaction rollbacks all...

In Ruby on Rails 5 belongs_to associations required by default so the following code: class User < ApplicationRecord end class Post < ApplicationRecord belongs_to :user # to make it work in...

Best results in other decks

Ruby has two different ways to match the start and the end of a text: ^ (Start of line) and $ (End...

...you are also okay, in this case the JOIN might have slightly better performance. Related Also see our card How to tell ActiveRecord how to preload associations (either JOINs or...

Search in all decks