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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2ee29689040f515048d33262d9717d47e4572ea
4
- data.tar.gz: cfc014bf93106d3b0c82709f03da3ba3546b81e3
3
+ metadata.gz: 9c4dabb59c39d74815cb2926b18b047ea1b9a3bd
4
+ data.tar.gz: 91cb6d66da2f2bc880b0c5618a839c9cf15be0e5
5
5
  SHA512:
6
- metadata.gz: 3d42c93804677c2df22c6706e1a716d1da502d0b0f73b4e9f5dfb9237f03cc1bb8c92f2b7ab629b9ae5f7c6bd7f4649626785a8050eea53cc0db3b4f83209c07
7
- data.tar.gz: 4c8e491a147aff637ab02c7a4d7bb9b42c345b154ac59a2989e2e3c857008f418f3c9a2e4d6bda985a10b497f252b390458e732595e94f743ba8855e2118d593
6
+ metadata.gz: 2425ea78f299462e2acffadcd9c5e6fec4c2a2bcc703166b142c4ce8f9669311d782abc7b55affda0fb81db94da22c9688b6b0d55862698b18dc6bc19eeeac26
7
+ data.tar.gz: bff8c5562fae1714daa24db023b627214e1ba239c2ded32855eafd9dc71730d1161cd792613a3bc5cdcecc7806cfdc2a9706573602d87578682646252b3afa86
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm use 2.1.0@clerk --create
1
+ rvm use 2.3.1@clerk --create
@@ -1,8 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "1.9.3"
4
- - "2.0.0"
5
- - "2.1.7"
6
- - "2.2.3"
7
- - jruby-19mode # JRuby in 1.9 mode
3
+ - "2.2.6"
4
+ - "2.3.1"
5
+ - "2.3.2"
6
+ - "2.3.3"
7
+ - "2.4.0"
8
8
  script: bundle exec rspec spec
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`
@@ -22,10 +22,9 @@ Gem::Specification.new do |gem|
22
22
  gem.version = Clerk::VERSION
23
23
  gem.licenses = ['MIT']
24
24
 
25
- # gem.add_dependency 'rails', '~> 3'
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.3.3'
27
+ gem.add_dependency 'sentient_user', '>= 0.4.0'
29
28
 
30
29
 
31
30
  gem.add_development_dependency 'bundler', '>= 1.1.3'
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Clerk
2
- VERSION = "0.2.3"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -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.2.3
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: '3'
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: '3'
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.3.3
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.3.3
54
+ version: 0.4.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement