solidus_simple_sale_price 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f6b45abb7ef95302cd8514326df022eefee06a726c2d2f867a5f67eef0ba719
4
- data.tar.gz: 63c92ac7cd485f8b7e4ba6441397abe7114e5461f7e98ead01772b18eba106ed
3
+ metadata.gz: 1890c3963e1dacd955f8fc96a40e4da8434ff9d65c92fed1dcae087720cad857
4
+ data.tar.gz: 28dabfee8eddb42c863c00dd7dd529419f260d6d8b2f47e5f55c64865d28d810
5
5
  SHA512:
6
- metadata.gz: 5a1811fa669cf1c32d4c3aef88d444712c335f238a0275a03c9a8ba774d60832d091464b7af124cbbdafcd28accf95c835575700d9831278139df698ebb4b4e0
7
- data.tar.gz: 067a2c21982980c5a0d9d45bba03cd1379836eb83a562a61216948473b0ccc0837cff577d8069a47c6d2b933f1d7f97a12e25d55a1c18b168456aa9d2941cf92
6
+ metadata.gz: 46c60de6bf15ee8fd9a1a5324a988b4ba27759400d70393009034e35e2d8904e45860b583fc29a0685db6650ba84438d4d2aa087bb5a4d0cc79be80c29e105cc
7
+ data.tar.gz: 6bb613db938ab0201e476ffecf6670e460699cfb6901880d098d6428e81e44311cbc39a109c374bb47955f6a00611e4b178f9fd3202fbfab47f32985989ce81c
@@ -8,7 +8,7 @@ Spree::Price.class_eval do
8
8
  end
9
9
 
10
10
  def on_sale?
11
- sale_amount.present? && sale_amount < original_amount
11
+ sale_amount.present? && original_amount.present? && sale_amount < original_amount
12
12
  end
13
13
 
14
14
  def amount
@@ -2,7 +2,7 @@ Spree::Variant.class_eval do
2
2
  delegate :on_sale?, :discount_percent, to: :default_price
3
3
 
4
4
  def on_sale_in?(currency)
5
- price_in_currency(currency).on_sale?
5
+ !!price_in_currency(currency)&.on_sale?
6
6
  end
7
7
 
8
8
  def sale_price
@@ -6,12 +6,12 @@ FactoryBot.define do
6
6
  # require 'solidus_simple_sale_price/factories'
7
7
 
8
8
  factory :price_on_sale, parent: :price do
9
- sale_amount 10.90
9
+ sale_amount { 10.90 }
10
10
  end
11
11
 
12
12
  factory :international_variant, parent: :variant do
13
13
  transient do
14
- price_currencies %w[KES UAH AUD]
14
+ price_currencies { %w[KES UAH AUD] }
15
15
  end
16
16
 
17
17
  after(:create) do |variant, evaluator|
@@ -1,3 +1,3 @@
1
1
  module SolidusSimpleSalePrice
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_simple_sale_price
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josua Schmid
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-21 00:00:00.000000000 Z
11
+ date: 2022-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core
@@ -212,7 +212,7 @@ homepage: http://github.com/renuo/solidus_simple_sale_price
212
212
  licenses:
213
213
  - BSD-3-Clause
214
214
  metadata: {}
215
- post_install_message:
215
+ post_install_message:
216
216
  rdoc_options: []
217
217
  require_paths:
218
218
  - lib
@@ -227,9 +227,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  - !ruby/object:Gem::Version
228
228
  version: '0'
229
229
  requirements: []
230
- rubyforge_project:
231
- rubygems_version: 2.7.3
232
- signing_key:
230
+ rubygems_version: 3.3.10
231
+ signing_key:
233
232
  specification_version: 4
234
233
  summary: Adds sale price functionality to Solidus
235
234
  test_files: []