Skip to content

Commit

Permalink
Merge pull request #2468 from jhawthorn/mysql_fixes
Browse files Browse the repository at this point in the history
Fixes for MySQL
  • Loading branch information
jhawthorn authored Jan 2, 2018
2 parents b7753a4 + dbbfd21 commit 36bb217
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion backend/spec/features/admin/users_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@
end

context "member since" do
before do
user_a.update_column(:created_at, 2.weeks.ago)
end

it_behaves_like "a sortable attribute" do
let(:text_match_1) { user_a.email }
let(:text_match_2) { user_b.email }
Expand All @@ -107,7 +111,6 @@
end

it 'displays the correct results for a user search by creation date' do
user_a.update_column(:created_at, 2.weeks.ago)
fill_in 'q_created_at_lt', with: 1.week.ago
click_button 'Search'
within_table('listing_users') do
Expand Down
5 changes: 4 additions & 1 deletion core/db/migrate/20160101010000_solidus_one_four.rb
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,10 @@ def up
t.index ["deleted_at"], name: "index_spree_stock_items_on_deleted_at"
t.index ["stock_location_id", "variant_id"], name: "stock_item_by_loc_and_var_id"
t.index ["stock_location_id"], name: "index_spree_stock_items_on_stock_location_id"
t.index ["variant_id", "stock_location_id"], name: "index_spree_stock_items_on_variant_id_and_stock_location_id", unique: true, where: "deleted_at is null"

if connection.supports_partial_index?
t.index ["variant_id", "stock_location_id"], name: "index_spree_stock_items_on_variant_id_and_stock_location_id", unique: true, where: "deleted_at is null"
end
end

create_table "spree_stock_locations", force: :cascade do |t|
Expand Down
2 changes: 2 additions & 0 deletions core/spec/models/spree/classification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def positions_to_be_valid(taxon)
taxon = taxon_with_5_products
classification = taxon.classifications.first
product = classification.product
product.update_columns(updated_at: 1.day.ago)
expect {
classification.touch
}.to change { product.reload.updated_at }
Expand All @@ -102,6 +103,7 @@ def positions_to_be_valid(taxon)
it "touches the taxon" do
taxon = taxon_with_5_products
classification = taxon.classifications.first
taxon.update_columns(updated_at: 1.day.ago)
expect {
classification.touch
}.to change { taxon.reload.updated_at }
Expand Down

0 comments on commit 36bb217

Please sign in to comment.