unidom-price 0.3 → 1.0

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
  SHA1:
3
- metadata.gz: a7422b3380bb3fa170c26e2001ba508c80f0cae8
4
- data.tar.gz: 9f885c54e377a75b55349076a35ccc609e495576
3
+ metadata.gz: a9370286f72e971335bf587503cdc19f4d370ed5
4
+ data.tar.gz: 740b638fdc088755a54135ed7aa5085935ba544a
5
5
  SHA512:
6
- metadata.gz: ffa0e8904aa5687e5c4faa4aa2c6915ae8c90a15a3baac070d22ecf667917b602e4df794c2615a2cb9453577364e5519a3f42139d310c68b82f18dc7c75fae5d
7
- data.tar.gz: 2f1e37d460c02356f5e15aabb2cd8ff7eda7614e9d25058ead43e84d3102305211311d04d69e4a5f4cca8fbca76000e87f415d086f64a03d962c75d56a391602
6
+ metadata.gz: fe9a7895ba1baad61ce405e1df4995ec8e77e26885aac2de8ad8158a6d4bb7d094c420a18d428e72496c2221f1688023027fe941b7469f546f37e984ce65b20d
7
+ data.tar.gz: 68bb094fd236620822023ce454e8b5d7abdc9483f6b797c436819c1f9a620a43b6c15db34f0bfa00189b0490fb97cf53b746e34fbc06cdd7d94c0101f00f11fa
data/README.md CHANGED
@@ -51,5 +51,5 @@ promotion_price = Unidom::Price::Price.create(priced: product,
51
51
  prices = Unidom::Price::Price.priced_is(product).priced_by(pricer).charging_coded_as('ONCE').currency_coded_as('RMB').valid_at.alive.first
52
52
 
53
53
  # Price a product
54
- Unidom::Price::Price.price! product, amount
54
+ Unidom::Price::Price.price! product, amount: 100
55
55
  ```
@@ -14,7 +14,7 @@ class Unidom::Price::Price < ActiveRecord::Base
14
14
  scope :priced_by, ->(pricer) { where pricer: pricer }
15
15
  scope :priced_is, ->(priced) { where priced: priced }
16
16
 
17
- def self.price!(priced, amount, pricer = nil, calculation_code = 'AMNT', pricing_code = 'BASE', charging_code = 'ONCE', opened_at = Time.now)
17
+ def self.price!(priced, amount: 0, pricer: nil, calculation_code: 'AMNT', pricing_code: 'BASE', charging_code: 'ONCE', opened_at: Time.now)
18
18
  price = priced_is(priced).calculation_coded_as(calculation_code).pricing_coded_as(pricing_code).charging_coded_as(charging_code).valid_at.alive.first
19
19
  if price.present?
20
20
  price.amount = amount
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Price
3
- VERSION = '0.3'.freeze
3
+ VERSION = '1.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-price
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '1.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-21 00:00:00.000000000 Z
11
+ date: 2016-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.9'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.9'
27
27
  description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.