Skip to content
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

Merged
merged 5 commits into from Oct 13, 2015
Merged

Refactor validations #6815

merged 5 commits into from Oct 13, 2015

Conversation

tanmay3011
Copy link
Contributor

No description provided.

@TeatroIO
Copy link

TeatroIO commented Oct 6, 2015

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,

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")

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 }

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.

JDutil added a commit that referenced this pull request Oct 13, 2015
@JDutil JDutil merged commit 485cf76 into spree:master Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants