News

Rails 6.1 adds ActiveRecord::FinderMethods 'sole' and 'find_sole_by' | BigBinary Blog
There were no methods defined to find and assert the presence of exactly one record at the same time.For example, we have a class Product with a price field and we want to find a single product that has a price of 100. For zero or multiple product...



Active Record queries in views: when it's bad, when it's fine - Code with Jason
Maybe you’ve heard the advice that you shouldn’t put Active Record queries (or other logic) in views, but you’re not sure exactly why, other than “separation of concerns”. Why exactly is separation of concerns good?The rationale behind this advice...




