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 +4 -4
- data/README.md +1 -1
- data/app/models/unidom/price/price.rb +1 -1
- data/lib/unidom/price/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9370286f72e971335bf587503cdc19f4d370ed5
|
4
|
+
data.tar.gz: 740b638fdc088755a54135ed7aa5085935ba544a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
data/lib/unidom/price/version.rb
CHANGED
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
|
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-
|
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.
|