activemodel
Nothing to display jet.
Nothing to display jet.
Sometimes there are some external validations that are brought in our #active_record models by some gems. Usually these validations are useful, but sometimes we don't want such validations, if we want redefine some gem's behavior.
So, I show you how to cancel validation in ActiveRecord model, for example Devise's validation of email uniqueness. More under the cut
State Machine comes to the rescue when models in your application need statuses and events.
There is a #state_machine gem for #ruby.
I recommend you to spend some time studying basics before you start using it with #rails. More under the cut
Today I tried to guess why my error messages aren't translated and found a nice debug method.
It is keys method of ActiveModel::Errors. example under the cut
Somebody doesn't know what will happen after calling the callback who return false, but it is important thing to know about #activerecord. More under the cut
I wrote a #microgem for a simple validation a state of the object with #statemachine More under the cut