clerk 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rvmrc +1 -1
- data/.travis.yml +5 -5
- data/README.md +5 -0
- data/clerk.gemspec +2 -3
- data/lib/clerk.rb +2 -2
- data/lib/clerk/version.rb +1 -1
- data/spec/clerk_spec.rb +17 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c4dabb59c39d74815cb2926b18b047ea1b9a3bd
|
4
|
+
data.tar.gz: 91cb6d66da2f2bc880b0c5618a839c9cf15be0e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2425ea78f299462e2acffadcd9c5e6fec4c2a2bcc703166b142c4ce8f9669311d782abc7b55affda0fb81db94da22c9688b6b0d55862698b18dc6bc19eeeac26
|
7
|
+
data.tar.gz: bff8c5562fae1714daa24db023b627214e1ba239c2ded32855eafd9dc71730d1161cd792613a3bc5cdcecc7806cfdc2a9706573602d87578682646252b3afa86
|
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm use 2.1
|
1
|
+
rvm use 2.3.1@clerk --create
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -34,6 +34,11 @@ Or install it yourself as:
|
|
34
34
|
|
35
35
|
Then follow the directions under Setup
|
36
36
|
|
37
|
+
### Version Notes
|
38
|
+
|
39
|
+
* Use `0.2.x` for rails 4
|
40
|
+
* Use `0.3.x` for rails 5
|
41
|
+
|
37
42
|
## Setup
|
38
43
|
|
39
44
|
Step 1: include the `sentient_user` SentientUser module on your User `/app/models/user.rb`
|
data/clerk.gemspec
CHANGED
@@ -22,10 +22,9 @@ Gem::Specification.new do |gem|
|
|
22
22
|
gem.version = Clerk::VERSION
|
23
23
|
gem.licenses = ['MIT']
|
24
24
|
|
25
|
-
|
26
|
-
gem.add_dependency 'activerecord', '> 3'
|
25
|
+
gem.add_dependency 'activerecord', '> 5'
|
27
26
|
gem.add_dependency 'railties', '> 3.1'
|
28
|
-
gem.add_dependency 'sentient_user', '>= 0.
|
27
|
+
gem.add_dependency 'sentient_user', '>= 0.4.0'
|
29
28
|
|
30
29
|
|
31
30
|
gem.add_development_dependency 'bundler', '>= 1.1.3'
|
data/lib/clerk.rb
CHANGED
@@ -13,7 +13,7 @@ module Clerk
|
|
13
13
|
creator_fk = options.fetch(:creator_foreign_key) { "created_by_id" }
|
14
14
|
updater_fk = options.fetch(:updater_foreign_key) { "updated_by_id" }
|
15
15
|
|
16
|
-
belongs_to :creator, :class_name => "User", :foreign_key => creator_fk
|
17
|
-
belongs_to :updater, :class_name => "User", :foreign_key => updater_fk
|
16
|
+
belongs_to :creator, :class_name => "User", :foreign_key => creator_fk, :optional => true
|
17
|
+
belongs_to :updater, :class_name => "User", :foreign_key => updater_fk, :optional => true
|
18
18
|
end
|
19
19
|
end
|
data/lib/clerk/version.rb
CHANGED
data/spec/clerk_spec.rb
CHANGED
@@ -77,6 +77,22 @@ describe Clerk do
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
+
describe "optional association in User itself creation" do
|
81
|
+
Post.extend Clerk
|
82
|
+
|
83
|
+
class PostExtended < Post
|
84
|
+
track_who_does_it
|
85
|
+
end
|
86
|
+
|
87
|
+
it "by creator" do
|
88
|
+
this = User.new(:name => "name")
|
89
|
+
this.save
|
90
|
+
|
91
|
+
this.created_by_id.should == nil
|
92
|
+
this.updated_by_id.should == nil
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
80
96
|
describe "warning messages" do
|
81
97
|
Post.extend Clerk
|
82
98
|
|
@@ -141,4 +157,4 @@ describe Clerk do
|
|
141
157
|
end
|
142
158
|
end
|
143
159
|
end
|
144
|
-
end
|
160
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clerk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesse House
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5'
|
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: '
|
26
|
+
version: '5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: railties
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.4.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.4.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|