unidom-price 1.3 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -4
- data/Rakefile +2 -2
- data/app/assets/config/unidom-price_manifest.js +2 -0
- data/app/assets/javascripts/unidom/price/application.js +1 -1
- data/app/assets/stylesheets/unidom/price/application.css +3 -3
- data/app/controllers/unidom/price/application_controller.rb +1 -0
- data/app/jobs/unidom/price/application_job.rb +2 -0
- data/app/mailers/unidom/price/application_mailer.rb +4 -0
- data/app/models/unidom/price/application_record.rb +3 -0
- data/app/models/unidom/price/price.rb +1 -1
- data/lib/unidom/price/version.rb +1 -1
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bc272b4c41f8ad734578edce65aff9fbc44cfde
|
4
|
+
data.tar.gz: 1408312cb6d910c517b18abd0199b854adcbbedf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed0d07fca867893dd409e648f792d53cf8df0acd71835c4088973d097741a4be377aeb4364d447d0fd1eb5f9fb8b10bb3a2b2484147d1521ec7d82f64efda511
|
7
|
+
data.tar.gz: 7b3659a073aad2d57ef3b1bd630538f2abc5605c234cfa450161e61671838ac8f408423ec6e73947beaa398f1b40d0add4363a1ebbdf748337e70089bf2dee3e
|
data/README.md
CHANGED
@@ -2,26 +2,39 @@
|
|
2
2
|
|
3
3
|
[![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/unidom-price.svg)](https://badge.fury.io/rb/unidom-price)
|
5
|
+
[![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-price.svg)](https://gemnasium.com/github.com/topbitdu/unidom-price)
|
5
6
|
|
6
7
|
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Price domain model engine includes Pricing and its relative models.
|
7
8
|
Unidom (统一领域对象模型)是一系列的领域模型引擎。价格领域模型引擎包括定价及其相关的模型。
|
8
9
|
|
10
|
+
|
11
|
+
|
9
12
|
## Recent Update
|
13
|
+
|
10
14
|
Check out the [Road Map](ROADMAP.md) to find out what's the next.
|
11
15
|
Check out the [Change Log](CHANGELOG.md) to find out what's new.
|
12
16
|
|
17
|
+
|
18
|
+
|
13
19
|
## Usage in Gemfile
|
20
|
+
|
14
21
|
```ruby
|
15
22
|
gem 'unidom-price'
|
16
23
|
```
|
17
24
|
|
25
|
+
|
26
|
+
|
18
27
|
## Run the Database Migration
|
28
|
+
|
19
29
|
```shell
|
20
30
|
rake db:migrate
|
21
31
|
```
|
22
32
|
The migration versions start with 200203.
|
23
33
|
|
34
|
+
|
35
|
+
|
24
36
|
## Call the Model
|
37
|
+
|
25
38
|
```ruby
|
26
39
|
# Create 2 Prices for the same product
|
27
40
|
product = Product.create name: 'iPhone 6S'
|
@@ -57,19 +70,22 @@ Unidom::Price::Price.price! product, amount: 100
|
|
57
70
|
|
58
71
|
|
59
72
|
## Include the Concerns
|
73
|
+
|
60
74
|
```ruby
|
61
75
|
include Unidom::Price::Concerns::AsPriced
|
62
76
|
include Unidom::Price::Concerns::AsPricer
|
63
77
|
```
|
64
78
|
|
65
79
|
### As Priced
|
80
|
+
|
66
81
|
The As Priced concern do the following tasks for the includer automatically:
|
67
|
-
1. Define the has_many :prices macro as: ``has_many :prices, class_name: 'Unidom::Price::Price', as: :priced``
|
68
|
-
2. Define the #is_priced! method as: ``is_priced!(amount, by: nil, at: Time.now)``
|
82
|
+
1. Define the has_many :prices macro as: ``has_many :prices, class_name: 'Unidom::Price::Price', as: :priced``
|
83
|
+
2. Define the #is_priced! method as: ``is_priced!(amount, by: nil, at: Time.now)``
|
69
84
|
3. Define the #is_priced? method as: ``is_priced?(at: Time.now)``
|
70
85
|
|
71
86
|
### As Pricer
|
87
|
+
|
72
88
|
The As Priced concern do the following tasks for the includer automatically:
|
73
|
-
1. Define the has_many :pricings macro as: ``has_many :pricings, class_name: 'Unidom::Price::Price', as: :pricer``
|
74
|
-
2. Define the #price! method as: ``price!(it, amount, at: Time.now)``
|
89
|
+
1. Define the has_many :pricings macro as: ``has_many :pricings, class_name: 'Unidom::Price::Price', as: :pricer``
|
90
|
+
2. Define the #price! method as: ``price!(it, amount, at: Time.now)``
|
75
91
|
3. Define the #price? method as: ``price?(it, at: Time.now)``
|
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
10
10
|
rdoc.rdoc_dir = 'rdoc'
|
11
11
|
rdoc.title = 'Unidom Price'
|
12
12
|
rdoc.options << '--line-numbers'
|
13
|
-
rdoc.rdoc_files.include('README.
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
14
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
15
|
end
|
16
16
|
|
@@ -20,5 +20,5 @@ load 'rails/tasks/statistics.rake'
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
|
23
|
+
require 'bundler/gem_tasks'
|
24
24
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
6
|
//
|
7
7
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
9
|
//
|
10
10
|
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
11
|
// about supported directives.
|
@@ -6,9 +6,9 @@
|
|
6
6
|
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
7
|
*
|
8
8
|
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any
|
10
|
-
*
|
11
|
-
* file per style scope.
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
12
|
*
|
13
13
|
*= require_self
|
14
14
|
*/
|
data/lib/unidom/price/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-price
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.3.1
|
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-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.6'
|
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
|
-
version: '1.
|
26
|
+
version: '1.6'
|
27
27
|
description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
|
28
28
|
The Price domain model engine includes Pricing and its relative models. Unidom (统一领域对象模型)是一系列的领域模型引擎。价格领域模型引擎包括定价及其相关的模型。
|
29
29
|
email:
|
@@ -35,10 +35,14 @@ files:
|
|
35
35
|
- MIT-LICENSE
|
36
36
|
- README.md
|
37
37
|
- Rakefile
|
38
|
+
- app/assets/config/unidom-price_manifest.js
|
38
39
|
- app/assets/javascripts/unidom/price/application.js
|
39
40
|
- app/assets/stylesheets/unidom/price/application.css
|
40
41
|
- app/controllers/unidom/price/application_controller.rb
|
41
42
|
- app/helpers/unidom/price/application_helper.rb
|
43
|
+
- app/jobs/unidom/price/application_job.rb
|
44
|
+
- app/mailers/unidom/price/application_mailer.rb
|
45
|
+
- app/models/unidom/price/application_record.rb
|
42
46
|
- app/models/unidom/price/concerns/as_priced.rb
|
43
47
|
- app/models/unidom/price/concerns/as_pricer.rb
|
44
48
|
- app/models/unidom/price/price.rb
|