I am trying to save a record that does not have one set of fields that has a numeric check value in models. Although the presence is not required in the check, it still throws an error that the field is not a number.
Validation:
validates :network_id, :numericality => true
Code to save the model:
networks.each do |network| network.url = network.raw_data.link network.save! end
Mistake:
Validation failed: Network is not a number
ruby ruby-on-rails ruby-on-rails-3
Hopstream Nov 02 2018-11-11T00: 00Z
source share