We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there,
while using your gem, I've noticed that in case of ArgumentError (raised here) does not give any clues about what generated the error:
ArgumentError
#<ArgumentError: #<ActiveModel::Errors:0x007fd7680184b0>>
you should change the line with something like this:
raise ArgumentError.new("#{citizen.errors.inspect}") unless citizen.valid?
and now you'll get the entire ActiveModel::Errors object:
ActiveModel::Errors
#<ActiveModel::Errors:0x007f9d741933e0 @base=#<CodiceFiscale::ItalianCitizen:0x007f9d74193688 @attributes={:country_name=>"Italia", :name=>"Mario", :surname=>"Rossi", :gender=>:male, :birthdate=>Thu, 01 Jan 1987, :city_name=>654270}, @country_name="Italia", @name="Mario", @surname="Rossi", @gender=:male, @birthdate=Thu, 01 Jan 1987, @city_name=654270, @validation_context=nil, @errors=#<ActiveModel::Errors:0x007f9d741933e0 ...>>, @messages={:province_code=>["non può essere lasciato in bianco"]}>
The text was updated successfully, but these errors were encountered:
23d859a
fix #2 (validation error not meaningful)
3eea4fb
No branches or pull requests
Hi there,
while using your gem, I've noticed that in case of
ArgumentError
(raised here) does not give any clues about what generated the error:you should change the line with something like this:
and now you'll get the entire
ActiveModel::Errors
object:The text was updated successfully, but these errors were encountered: