Akshay Mohite

Ruby on Rails / ReactJS Enthusiast.

Rails 6 adds delete_by and destroy_by methods on ActiveRecord

Often we need to find records based on certain conditions and then delete those records. To perform this, ActiveRecord has introduced delete_by and destroy_by methods with Rails 6. Let’s say, we have a following model. Requirement: Delete all posts created by a user with ID 5. Before Rails 6 This can be done by using …

Rails 6 adds delete_by and destroy_by methods on ActiveRecord Read More »

Rails 6 ActiveSupport adds private option to delegated methods

Rails 6 is recently released with a lot of features. One of them is ActiveSupport adding support for private option on delegated methods to make delegated methods not accessible publicly. Before Rails 6 Before Rails 6, if we use delegate option for methods, it marks the delegated method publicly accessible. This could be undesirable at …

Rails 6 ActiveSupport adds private option to delegated methods Read More »

Rails 6 deprecates controller level force_ssl option

Previously, we were able to force_ssl to specific controller actions by using force_ssl callback at controller level. Rails 6 deprecates this option setting at controller level. This option to force_ssl is now available only at Rails application configuration level only. Before Rails 6 Let’s say, we have a resource configured for posts. The controller has …

Rails 6 deprecates controller level force_ssl option Read More »