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

Unique indexes for number fields #7870

Merged
merged 7 commits into from Mar 22, 2017

Conversation

Projects
None yet
3 participants
@mauazua
Contributor

mauazua commented Mar 21, 2017

This PR introduces unique indexes for number fields in following classes:

  • Spree::CustomerReturn
  • Spree::Order
  • Spree::Payment
  • Spree::Reimbursement
  • Spree::ReturnAuthorization
  • Spree::Shipment
  • Spree::StockTransfer
@@ -0,0 +1,17 @@
class AddUniqueIndexOnNumberToSpreePayments < ActiveRecord::Migration[5.0]

This comment has been minimized.

@houndci-bot

houndci-bot Mar 21, 2017

Missing frozen string literal comment.

@houndci-bot

houndci-bot Mar 21, 2017

Missing frozen string literal comment.

@@ -0,0 +1,16 @@
class AddUniqueIndexOnNumberToSpreeCustomerReturns < ActiveRecord::Migration[5.0]

This comment has been minimized.

@houndci-bot

houndci-bot Mar 21, 2017

Missing frozen string literal comment.

@houndci-bot

houndci-bot Mar 21, 2017

Missing frozen string literal comment.

authorizations = Spree::ReturnAuthorization.where(number: numbers)
authorizations.find_each do |authorization|
authorization.number = authorization.class.number_generator.method(:generate_permalink).call(authorization.class)

This comment has been minimized.

@houndci-bot

houndci-bot Mar 21, 2017

Line is too long. [121/120]

@houndci-bot

houndci-bot Mar 21, 2017

Line is too long. [121/120]

@@ -0,0 +1,16 @@
class AddUniqueIndexOnNumberToSpreeReturnAuthorizations < ActiveRecord::Migration[5.0]

This comment has been minimized.

@houndci-bot

houndci-bot Mar 21, 2017

Missing frozen string literal comment.

@houndci-bot

houndci-bot Mar 21, 2017

Missing frozen string literal comment.

Show outdated Hide outdated ...ate/20170316154338_add_unique_index_on_number_to_spree_stock_transfer.rb
@@ -0,0 +1,16 @@
class AddUniqueIndexOnNumberToSpreeShipment < ActiveRecord::Migration[5.0]

This comment has been minimized.

@houndci-bot

houndci-bot Mar 21, 2017

Missing frozen string literal comment.

@houndci-bot

houndci-bot Mar 21, 2017

Missing frozen string literal comment.

reimbursements = Spree::Reimbursement.where(number: numbers)
reimbursements.find_each do |reimbursement|
reimbursement.number = reimbursement.class.number_generator.method(:generate_permalink).call(reimbursement.class)

This comment has been minimized.

@houndci-bot

houndci-bot Mar 21, 2017

Line is too long. [121/120]

@houndci-bot

houndci-bot Mar 21, 2017

Line is too long. [121/120]

@@ -0,0 +1,16 @@
class AddUniqueIndexOnNumberToSpreeReimbursements < ActiveRecord::Migration[5.0]

This comment has been minimized.

@houndci-bot

houndci-bot Mar 21, 2017

Missing frozen string literal comment.

@houndci-bot

houndci-bot Mar 21, 2017

Missing frozen string literal comment.

@@ -0,0 +1,16 @@
class AddUniqueIndexOnNumberToSpreeOrders < ActiveRecord::Migration[5.0]

This comment has been minimized.

@houndci-bot

houndci-bot Mar 21, 2017

Missing frozen string literal comment.

@houndci-bot

houndci-bot Mar 21, 2017

Missing frozen string literal comment.

@damianlegawiec damianlegawiec added this to the v3.3.x milestone Mar 21, 2017

@damianlegawiec damianlegawiec merged commit 5cadd24 into spree:master Mar 22, 2017

2 checks passed

ci/circleci Your tests passed on CircleCI!
Details
hound 3 violations found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment