New issue
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
Refactor validations #6815
Refactor validations #6815
Conversation
I've prepared a stage to preview changes. Open stage or view logs. |
validates :stock_item | ||
validates :quantity, numericality: { | ||
greater_than_or_equal_to: -2**31, | ||
less_than_or_equal_to: 2**31-1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surrounding space missing for operator '-'.
@@ -75,7 +75,7 @@ def index | |||
resource.valid? # get some errors | |||
expect(subject).to receive(:index).and_raise(ActiveRecord::RecordInvalid.new(resource)) | |||
get :index, token: 'exception-message' | |||
expect(json_response).to eql('exception' => "Validation failed: Name can't be blank, Price can't be blank, Shipping category can't be blank") | |||
expect(json_response).to eql('exception' => "Validation failed: Name can't be blank, Shipping category can't be blank, Price can't be blank") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [145/120]
validates :item_count, numericality: { greater_than_or_equal_to: 0, less_than: 2**31, only_integer: true, allow_blank: true } | ||
end | ||
validates :payment_state, inclusion: { in: ['balance_due', 'paid', 'credit_owed', 'failed', 'void'], allow_blank: true } | ||
validates :shipment_state, inclusion: { in: ['ready', 'pending', 'partial', 'shipped', 'backorder', 'canceled'], allow_blank: true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [145/120]
Unnecessary spacing detected.
No description provided.