This blog is part of our Rails 6 series.
Rails 6.0 was recently released.
Rails 6 adds
:private option to
After this addition, we can delegate methods in the private scope.
Let’s checkout how it works.
Let’s create two models named as
Order. Let’s also delegate
validate_state method in
Now, let’s add
private: true to the delegation.
As we can see, Rails now raises an exception of private method called if
option is set with
Here is the relevant