Skip to content

Commit

Permalink
Merge pull request #3668 from luisramos0/2-0-stable-Mar29
Browse files Browse the repository at this point in the history
[Spree Upgrade] Merging master into 2-0-stable (4th run in Mar2019)
  • Loading branch information
luisramos0 authored Apr 9, 2019
2 parents 449e587 + e9491ce commit 4478d51
Show file tree
Hide file tree
Showing 29 changed files with 1,214 additions and 162 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public/images
public/spree
config/abr.yml
config/initializers/feature_toggle.rb
config/initializers/db2fog.rb
NERD_tree*
coverage
libpeerconnection.log
Expand Down
1 change: 0 additions & 1 deletion .rubocop_manual_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ Metrics/LineLength:
- spec/lib/open_food_network/order_cycle_form_applicator_spec.rb
- spec/lib/open_food_network/order_cycle_permissions_spec.rb
- spec/lib/open_food_network/order_grouper_spec.rb
- spec/lib/open_food_network/orders_and_fulfillments_report_spec.rb
- spec/lib/open_food_network/packing_report_spec.rb
- spec/lib/open_food_network/permissions_spec.rb
- spec/lib/open_food_network/products_and_inventory_report_spec.rb
Expand Down
4 changes: 0 additions & 4 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Layout/AlignArray:
Exclude:
- 'lib/open_food_network/bulk_coop_report.rb'
- 'lib/open_food_network/customers_report.rb'
- 'lib/open_food_network/order_and_distributor_report.rb'
- 'lib/open_food_network/orders_and_fulfillments_report.rb'
- 'lib/open_food_network/packing_report.rb'
- 'spec/lib/open_food_network/order_grouper_spec.rb'
Expand Down Expand Up @@ -703,7 +702,6 @@ Layout/SpaceInsideBlockBraces:
- 'spec/helpers/spree/orders_helper_spec.rb'
- 'spec/lib/open_food_network/order_cycle_form_applicator_spec.rb'
- 'spec/lib/open_food_network/order_grouper_spec.rb'
- 'spec/lib/open_food_network/orders_and_fulfillments_report_spec.rb'
- 'spec/lib/open_food_network/products_renderer_spec.rb'
- 'spec/lib/open_food_network/tag_rule_applicator_spec.rb'
- 'spec/models/column_preference_spec.rb'
Expand Down Expand Up @@ -1033,7 +1031,6 @@ Lint/Void:
- 'spec/lib/open_food_network/enterprise_fee_calculator_spec.rb'
- 'spec/lib/open_food_network/enterprise_issue_validator_spec.rb'
- 'spec/lib/open_food_network/group_buy_report_spec.rb'
- 'spec/lib/open_food_network/orders_and_fulfillments_report_spec.rb'
- 'spec/lib/open_food_network/packing_report_spec.rb'
- 'spec/lib/open_food_network/reports/report_spec.rb'
- 'spec/lib/open_food_network/reports/rule_spec.rb'
Expand Down Expand Up @@ -1923,7 +1920,6 @@ Style/MixinUsage:
- 'spec/features/admin/orders_spec.rb'
- 'spec/lib/open_food_network/bulk_coop_report_spec.rb'
- 'spec/lib/open_food_network/order_cycle_management_report_spec.rb'
- 'spec/lib/open_food_network/orders_and_fulfillments_report_spec.rb'
- 'spec/lib/open_food_network/packing_report_spec.rb'

# Offense count: 4
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-0-stable'
# - Pass customer email and phone number to PayPal (merged to upstream master)
# - Change type of password from string to password to hide it in the form
gem 'spree_paypal_express', github: "openfoodfoundation/better_spree_paypal_express", branch: "2-0-stable"
gem 'stripe', '~> 4.9.0'
gem 'stripe'

# We need at least this version to have Digicert's root certificate
# which is needed for Pin Payments (and possibly others).
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ GEM
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
oj (3.7.10)
oj (3.7.11)
orm_adapter (0.5.0)
paper_trail (5.2.3)
activerecord (>= 3.0, < 6.0)
Expand Down Expand Up @@ -721,7 +721,7 @@ GEM
tilt (~> 1.1, != 1.3.0)
state_machine (1.2.0)
stringex (1.5.1)
stripe (4.9.0)
stripe (4.11.0)
faraday (~> 0.13)
net-http-persistent (~> 3.0)
therubyracer (0.12.0)
Expand Down Expand Up @@ -860,7 +860,7 @@ DEPENDENCIES
spree_paypal_express!
spring (= 1.7.2)
spring-commands-rspec
stripe (~> 4.9.0)
stripe
therubyracer (= 0.12.0)
timecop
truncate_html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def destroy

respond_with(@variant) do |format|
format.html { redirect_to admin_product_variants_url(params[:product_id]) }
format.js { render_js_for_destroy }
format.js { render_js_for_destroy }
end
end

Expand Down
5 changes: 5 additions & 0 deletions app/models/concerns/address_display.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module AddressDisplay
def full_name_reverse
[lastname, firstname].reject(&:blank?).join(" ")
end
end
1 change: 1 addition & 0 deletions app/models/product_import/entry_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def mark_as_new_product(entry)
new_product = Spree::Product.new
new_product.assign_attributes(entry.attributes.except('id'))
new_product.supplier_id = entry.producer_id
entry.on_hand = 0 if entry.on_hand.nil?

if new_product.valid?
entry.validates_as = 'new_product' unless entry.errors?
Expand Down
2 changes: 2 additions & 0 deletions app/models/spree/address_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Spree::Address.class_eval do
include AddressDisplay

has_one :enterprise, dependent: :restrict
belongs_to :country, class_name: "Spree::Country"

Expand Down
3 changes: 2 additions & 1 deletion app/views/admin/enterprises/welcome.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
%p
= t('.welcome_text')
%strong
= "#{"producer " if @enterprise.is_primary_producer}profile"
- profile_translation_key = @enterprise.is_primary_producer ? '.producer_profile' : '.profile'
= t(profile_translation_key)

%section
%h2= t('.next_step')
Expand Down
15 changes: 0 additions & 15 deletions config/initializers/0_depricated_db2fog.rb

This file was deleted.

7 changes: 7 additions & 0 deletions config/initializers/db2fog.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See: https://github.com/yob/db2fog
DB2Fog.config = {
:aws_access_key_id => Spree::Config[:s3_access_key],
:aws_secret_access_key => Spree::Config[:s3_secret],
:directory => Spree::Config[:s3_bucket],
:provider => 'AWS'
}
Loading

0 comments on commit 4478d51

Please sign in to comment.