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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a325387226fa0999af27eaae18507795913ea095
4
- data.tar.gz: a3b4c43bc38dbf72d60b6107145587c8721f445a
3
+ metadata.gz: 0c49036c555f6069b0f25194b22deca5c1e38521
4
+ data.tar.gz: d718865a252494d1d2bc42283654a4583fe089b6
5
5
  SHA512:
6
- metadata.gz: 9d8c58a8bb124046ef4230e7ece3bebf815b70a77866d9461fb540a4f7d30720a2076837a6eba5abf0801a66cba00ae419928558032262f0aba6298310d2bd76
7
- data.tar.gz: 94a34fb04dfc9b320e36a08d2535d020ad9da9c34e698c7d62d2614fff4a0b0888ee2500967f77522a1082f2933a7b3920f52c4b8b6f06cc7a96e147b2f8451a
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.rdoc')
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
- Bundler::GemHelper.install_tasks
23
+ require 'bundler/gem_tasks'
24
24
 
@@ -0,0 +1,2 @@
1
+ //= link_directory ../javascripts/unidom/position .js
2
+ //= link_directory ../stylesheets/unidom/position .css
@@ -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 styles
10
- * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
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
  */
@@ -1,2 +1,3 @@
1
1
  class Unidom::Position::ApplicationController < ActionController::Base
2
+ protect_from_forgery with: :exception
2
3
  end
@@ -0,0 +1,2 @@
1
+ class Unidom::Position::ApplicationJob < ActiveJob::Base
2
+ end
@@ -0,0 +1,4 @@
1
+ class Unidom::Position::ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
@@ -0,0 +1,3 @@
1
+ class Unidom::Position::ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -1,6 +1,6 @@
1
1
  # Occupation 是职业。
2
2
 
3
- class Unidom::Position::Occupation < ActiveRecord::Base
3
+ class Unidom::Position::Occupation < Unidom::Position::ApplicationRecord
4
4
 
5
5
  self.table_name = 'unidom_occupations'
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Position 是职位。
2
2
 
3
- class Unidom::Position::Position < ActiveRecord::Base
3
+ class Unidom::Position::Position < Unidom::Position::ApplicationRecord
4
4
 
5
5
  self.table_name = 'unidom_positions'
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Post 是岗位。
2
2
 
3
- class Unidom::Position::Post < ActiveRecord::Base
3
+ class Unidom::Position::Post < Unidom::Position::ApplicationRecord
4
4
 
5
5
  self.table_name = 'unidom_posts'
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Post Reporting Structure 是岗位汇报结构。
2
2
 
3
- class Unidom::Position::PostReportingStructure < ActiveRecord::Base
3
+ class Unidom::Position::PostReportingStructure < Unidom::Position::ApplicationRecord
4
4
 
5
5
  self.table_name = 'unidom_post_reporting_structures'
6
6
 
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Position
3
- VERSION = '1.4'.freeze
3
+ VERSION = '1.4.1'.freeze
4
4
  end
5
5
  end
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: '1.4'
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-09-11 00:00:00.000000000 Z
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.0'
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.0'
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