Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Commit

Permalink
Remove environment attribute references in spree_trackers
Browse files Browse the repository at this point in the history
  • Loading branch information
Tania authored and Jeff Dutil committed Jun 11, 2015
1 parent 7bbbcd9 commit 7af2bbf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/spree/payment_method_decorator.rb
Expand Up @@ -4,8 +4,8 @@

def self.available(display_on = 'both', store = nil)
result = all.select do |p|
# (p.environment == Rails.env || p.environment.blank?) &&
p.active &&
(p.environment == Rails.env || p.environment.blank?) &&
(store.nil? || store.payment_methods.empty? || store.payment_methods.include?(p)) &&
(p.display_on == display_on.to_s || p.display_on.blank?)
end
Expand Down
3 changes: 2 additions & 1 deletion app/models/spree/tracker_decorator.rb
Expand Up @@ -2,6 +2,7 @@
belongs_to :store

def self.current(domain)
Spree::Tracker.where(:active => true, :environment => Rails.env).joins(:store).where("spree_stores.url LIKE ?", "%#{domain}%").first
# , :environment => Rails.env
Spree::Tracker.where(:active => true).joins(:store).where("spree_stores.url LIKE ?", "%#{domain}%").first
end
end
3 changes: 2 additions & 1 deletion app/views/spree/admin/stores/_form.html.erb
Expand Up @@ -66,7 +66,8 @@
<label class="sub">
<%= check_box_tag 'store[payment_method_ids][]', payment_method.id, @store.payment_methods.include?(payment_method) %>
</label> &nbsp;
<%= "#{payment_method.name} (#{payment_method.environment})" %>
<!-- "#{payment_method.name} (#{payment_method.environment})" -->
<%= payment_method.name %>
<br>
<% end %>
<%= hidden_field_tag 'store[payment_method_ids][]', '' %>
Expand Down

0 comments on commit 7af2bbf

Please sign in to comment.