Quantcast
Viewing latest article 39
Browse Latest Browse All 42

Answer by Ja͢ck for Prevent change of one field in Rails model

I recently came across this issue as well, and here's another way:

validates :activity_id, comparison: { equal_to: :activity_id_was }, on: :update

Alternatively, you can use activity_id_in_database instead of activity_id_was.


Viewing latest article 39
Browse Latest Browse All 42

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>