Rails 3 warns me that validate_on_create is deprecated. I have def validate_on_create in one of my models. What do I replace it with?
Rails 7 requires Ruby 2.7. 0 or newer. Rails 6 requires Ruby 2.5.
September 15, 2021 Welcome to the first alpha release of Rails 7. It brings some very exciting new answers to how we do JavaScript, an awesome approach to at-work encryption with Active Record,...
Ruby's and Ruby on Rails' Overall Popularity Although way behind main contenders, such as PHP or Python, Ruby still makes the cut for the 20 most popular programming languages list in 2022. The 2022 edition of Stack Overflow Annual Developer Survey also places RoR in a similar spot.
You can use:
validates :name, :presence => true, :on => :create
If you have a method that performs validations, you should run as:
validate :method_name, :on => :create
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With