unidom-position 1.4 → 1.4.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 +25 -5
- data/Rakefile +2 -2
- data/app/assets/config/unidom-position_manifest.js +2 -0
- data/app/assets/javascripts/unidom/position/application.js +1 -1
- data/app/assets/stylesheets/unidom/position/application.css +3 -3
- data/app/controllers/unidom/position/application_controller.rb +1 -0
- data/app/jobs/unidom/position/application_job.rb +2 -0
- data/app/mailers/unidom/position/application_mailer.rb +4 -0
- data/app/models/unidom/position/application_record.rb +3 -0
- data/app/models/unidom/position/occupation.rb +1 -1
- data/app/models/unidom/position/position.rb +1 -1
- data/app/models/unidom/position/post.rb +1 -1
- data/app/models/unidom/position/post_reporting_structure.rb +1 -1
- data/lib/unidom/position/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: 0c49036c555f6069b0f25194b22deca5c1e38521
|
4
|
+
data.tar.gz: d718865a252494d1d2bc42283654a4583fe089b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28decf137071925439397781d10a2a52ab9c82a759e91af335206a9717ddfbae3885258d36949ae9ff0401a2e24f1e3917fca54f387ac08c199756f60bfebcae
|
7
|
+
data.tar.gz: de37313bd3223961df9122a89426a4578ce467caf9684c2dc59f48a0386e16f2fddd6c1397e6fd8c362f6808e44e0d6760a1e297e2a41eabc0c44f53eb465e28
|
data/README.md
CHANGED
@@ -2,28 +2,40 @@
|
|
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-position.svg)](https://badge.fury.io/rb/unidom-position)
|
5
|
+
[![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-position.svg)](https://gemnasium.com/github.com/topbitdu/unidom-position)
|
5
6
|
|
6
7
|
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Position domain model engine includes the Occupation, Position, Post, and Position Reporting Structure 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-position'
|
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 200402.
|
23
33
|
|
34
|
+
|
35
|
+
|
24
36
|
## Call the Model
|
25
|
-
```ruby
|
26
37
|
|
38
|
+
```ruby
|
27
39
|
occupation = Unidom::Position::Occupation.valid_at.alive.first
|
28
40
|
|
29
41
|
position = Unidom::Position::Position.valid_at.alive.first
|
@@ -37,12 +49,18 @@ Unidom::Position::PostReportingStructure.report!(superior_post: chief_programmer
|
|
37
49
|
|
38
50
|
```
|
39
51
|
|
52
|
+
|
53
|
+
|
40
54
|
## Rake Task
|
55
|
+
|
41
56
|
```shell
|
42
57
|
bundle exec rake unidom:position:occupation:import file=/data.csv from_date=2009-11-01 thru_date=2015-10-01 scheme_id= scheme_type=
|
43
58
|
```
|
44
59
|
|
60
|
+
|
61
|
+
|
45
62
|
## Include the Concerns
|
63
|
+
|
46
64
|
The Post model already includes the following concerns:
|
47
65
|
```ruby
|
48
66
|
include Unidom::Position::Concerns::AsInferiorPost
|
@@ -50,15 +68,17 @@ include Unidom::Position::Concerns::AsSuperiorPost
|
|
50
68
|
```
|
51
69
|
|
52
70
|
### As Inferior Post
|
71
|
+
|
53
72
|
The As Inferior Post concern do the following tasks for the includer automatically:
|
54
73
|
1. Define the has_many :superior_post_reporting_structures macro as: ``has_many :superior_post_reporting_structures, class_name: 'Unidom::Position::PostReportingStructure', source: :inferior_post, foreign_key: :inferior_post_id``
|
55
|
-
2. Define the has_many :superior_posts macro as: ``has_many :superior_posts, through: :superior_post_reporting_structures, source: :superior_post``
|
56
|
-
3. Define the #report_to! method as: ``report_to!(superior_post, at: Time.now, primary: true)``
|
74
|
+
2. Define the has_many :superior_posts macro as: ``has_many :superior_posts, through: :superior_post_reporting_structures, source: :superior_post``
|
75
|
+
3. Define the #report_to! method as: ``report_to!(superior_post, at: Time.now, primary: true)``
|
57
76
|
4. Define the #report_to? method as: ``report_to?(superior_post, at: Time.now, primary: true)``
|
58
77
|
|
59
78
|
### As Superior Post
|
79
|
+
|
60
80
|
The As Superior Post concern do the following tasks for the includer automatically:
|
61
81
|
1. Define the has_many :inferior_post_reporting_structures macro as: ``has_many :inferior_post_reporting_structures, class_name: 'Unidom::Position::PostReportingStructure', source: :superior_post, foreign_key: :superior_post_id``
|
62
|
-
2. Define the has_many :inferior_posts macro as: ``has_many :inferior_posts, through: :inferior_post_reporting_structures, source: :inferior_post``
|
63
|
-
3. Define the #is_reported_to! method as: ``is_reported_to!(by: nil, at: Time.now, primary: true)``
|
82
|
+
2. Define the has_many :inferior_posts macro as: ``has_many :inferior_posts, through: :inferior_post_reporting_structures, source: :inferior_post``
|
83
|
+
3. Define the #is_reported_to! method as: ``is_reported_to!(by: nil, at: Time.now, primary: true)``
|
64
84
|
4. Define the #is_reported_to? method as: ``is_reported_to?(by: nil, at: Time.now, primary: true)``
|
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
10
10
|
rdoc.rdoc_dir = 'rdoc'
|
11
11
|
rdoc.title = 'Unidom Position'
|
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
|
*/
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-position
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.4.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-02 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 Position domain model engine includes the Occupation, Position, Post, and Position
|
29
29
|
Reporting Structure models. Unidom (统一领域对象模型)是一系列的领域模型引擎。职位领域模型引擎包括职业、职位、岗位及职位报告关系模型。
|
@@ -36,10 +36,14 @@ files:
|
|
36
36
|
- MIT-LICENSE
|
37
37
|
- README.md
|
38
38
|
- Rakefile
|
39
|
+
- app/assets/config/unidom-position_manifest.js
|
39
40
|
- app/assets/javascripts/unidom/position/application.js
|
40
41
|
- app/assets/stylesheets/unidom/position/application.css
|
41
42
|
- app/controllers/unidom/position/application_controller.rb
|
42
43
|
- app/helpers/unidom/position/application_helper.rb
|
44
|
+
- app/jobs/unidom/position/application_job.rb
|
45
|
+
- app/mailers/unidom/position/application_mailer.rb
|
46
|
+
- app/models/unidom/position/application_record.rb
|
43
47
|
- app/models/unidom/position/concerns/as_inferior_post.rb
|
44
48
|
- app/models/unidom/position/concerns/as_superior_post.rb
|
45
49
|
- app/models/unidom/position/occupation.rb
|