Skip to content

Commit

Permalink
Change variable names to enhance readability in helpers
Browse files Browse the repository at this point in the history
Related: #3294
  • Loading branch information
juliannatetreault committed Oct 24, 2019
1 parent 7363581 commit 2b4d2b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions core/app/helpers/spree/base_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ def taxon_breadcrumbs(taxon, separator = ' » ', breadcrumb_class

crumbs << [t('spree.products'), products_path]
if taxon
crumbs += taxon.ancestors.collect { |a| [a.name, spree.nested_taxons_path(a.permalink)] } unless taxon.ancestors.empty?
crumbs += taxon.ancestors.collect { |ancestor| [ancestor.name, spree.nested_taxons_path(ancestor.permalink)] } unless taxon.ancestors.empty?
crumbs << [taxon.name, spree.nested_taxons_path(taxon.permalink)]
end

separator = raw(separator)

items = crumbs.each_with_index.collect do |crumb, i|
items = crumbs.each_with_index.collect do |crumb, index|
content_tag(:li, itemprop: 'itemListElement', itemscope: '', itemtype: 'https://schema.org/ListItem') do
link_to(crumb.last, itemprop: 'item') do
content_tag(:span, crumb.first, itemprop: 'name') + tag('meta', { itemprop: 'position', content: (i + 1).to_s }, false, false)
content_tag(:span, crumb.first, itemprop: 'name') + tag('meta', { itemprop: 'position', content: (index + 1).to_s }, false, false)
end + (crumb == crumbs.last ? '' : separator)
end
end
Expand Down Expand Up @@ -122,7 +122,7 @@ def available_countries(restrict_to_zone: Spree::Config[:checkout_zone])
countries.collect do |country|
country.name = country_names.fetch(country.iso, country.name)
country
end.sort_by { |c| c.name.parameterize }
end.sort_by { |country| country.name.parameterize }
end

def seo_url(taxon)
Expand Down
2 changes: 1 addition & 1 deletion core/app/helpers/spree/products_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def variant_price_diff(variant)
def variant_full_price(variant)
return if variant.product.variants
.with_prices(current_pricing_options)
.all? { |v| v.price_same_as_master?(current_pricing_options) }
.all? { |variant| variant.price_same_as_master?(current_pricing_options) }
variant.price_for(current_pricing_options).to_html
end

Expand Down

0 comments on commit 2b4d2b3

Please sign in to comment.