unidom-common 0.6 → 0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e79e3b7b4db3ac70210a8fb88bac9c58e1668dbd
4
- data.tar.gz: 50a2c297eb2998f4957fd322cbcf36a36db348e5
3
+ metadata.gz: b96f049bc613e7a49dddeb8822ca4910070ab5f8
4
+ data.tar.gz: 684e39544b8284dc7ac5910b8c55a94aa2223b81
5
5
  SHA512:
6
- metadata.gz: 4bcf09c5fd2a2a21693ee10c85613fd972707e87f5bed752c78fb9975d6dfa3f023559bd984835361bfc97c5c6ff13e1fd3b3562054c63d26eef2b66d89ac9d8
7
- data.tar.gz: 6ee6028c6b9898951ff315dfdf09c0d8bbfc8e659dc24b1f0a68ee16559becb1bd6ff3df1538426789e29b75fcc2ffe4700609351a07802b2e953db162d2e674
6
+ metadata.gz: 5fd975d280c9992f6b82e0d1ed47d35ac3d28ae46d525771e3e30102451564ca9e2cd1ed8a8be47c6e662105718477ff0cb659d1d7df001f4aa911b4f38bd57b
7
+ data.tar.gz: 327407dd19b9d2f96161fb995b01980e8fa87db212653c63b276f0663214c36dbcae02d381f9387822a501ea111f1fd663e63adc7e528906c88cdf64288ac77d
data/README.md CHANGED
@@ -6,6 +6,10 @@
6
6
  Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Common domain model engine includes the common models.
7
7
  Unidom (统一领域对象模型)是一系列的领域模型引擎。常用领域模型引擎包括一些常用的模型。
8
8
 
9
+ ## Recent Update
10
+ Check out the [Road Map](ROADMAP.md) to find out what's the next.
11
+ Check out the [Change Log](CHANGELOG.md) to find out what's new.
12
+
9
13
  ## Usage in Gemfile
10
14
  ```ruby
11
15
  gem 'unidom-common'
@@ -28,7 +32,8 @@ class Project < ActiveRecord::Base
28
32
 
29
33
  include Unidom::Common::Concerns::ModelExtension
30
34
 
31
- validates :name, presence: true, length: { in: 2..200 }
35
+ validates :name, presence: true, length: { in: 2..200 }
36
+ validates :audition_state, presence: true, length: { is: 1 }
32
37
 
33
38
  belongs_to :customer
34
39
  belongs_to :team
@@ -44,6 +49,7 @@ Project.created_after('2015-01-01 00:00:00')
44
49
  Project.created_not_after('2015-01-01 00:00:00')
45
50
  Project.created_before('2015-01-01 00:00:00')
46
51
  Project.created_not_before('2015-01-01 00:00:00')
52
+ Project.audition_transited_to('A').transited_to('C')
47
53
  ```
48
54
 
49
55
  ## No-SQL Columns
@@ -100,6 +100,13 @@ module Unidom
100
100
  end
101
101
  end
102
102
 
103
+ if name.ends_with? '_state'
104
+ matched = /\A(.+)_state\z/.match name
105
+ class_eval do
106
+ scope :"#{matched[1]}_transited_to", ->(states) { where name => states }
107
+ end
108
+ end
109
+
103
110
  end
104
111
 
105
112
  includer.define_singleton_method :default_scope do
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Common
3
- VERSION = '0.6'.freeze
3
+ VERSION = '0.7'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-common
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: '0.7'
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-03-28 00:00:00.000000000 Z
11
+ date: 2016-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails