association_callbacks 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +24 -14
- data/VERSION +1 -1
- data/association_callbacks.gemspec +2 -1
- data/spec/association_callbacks/active_record_spec.rb +2 -2
- data/spec/association_callbacks_spec.rb +2 -2
- data/spec/spec_helper.rb +4 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 381659d911c93f3f2bed6c6be3054147df21abcd
|
4
|
+
data.tar.gz: 5a676c3389bcb8a53b668f5898bd282dca6c9bc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59425057bc90830dfe72321298dd13b0fb80900d90e09b0db13e57017ae7ebdeb76491da1daa2d08944e27947ec9e4e8db966a9e691b034fc3e9a4cc8b466d6c
|
7
|
+
data.tar.gz: 5edc96368d054e49a68796e25fab68b6a5f174b53cfbc9cbd60dfa820bf314a43a6de6550a173be0794940b90f714d3436264afd79cb09d019a7ff121e1d8ec5
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
association_callbacks (0.2.
|
4
|
+
association_callbacks (0.2.2)
|
5
5
|
activerecord (~> 4.1.0)
|
6
6
|
activesupport (~> 4.1.0)
|
7
7
|
|
@@ -23,24 +23,33 @@ GEM
|
|
23
23
|
tzinfo (~> 1.1)
|
24
24
|
arel (5.0.1.20140414130214)
|
25
25
|
builder (3.2.2)
|
26
|
+
byebug (3.1.2)
|
27
|
+
columnize (~> 0.8)
|
28
|
+
debugger-linecache (~> 1.2)
|
29
|
+
columnize (0.8.9)
|
30
|
+
debugger-linecache (1.2.0)
|
26
31
|
diff-lcs (1.2.5)
|
27
32
|
i18n (0.6.9)
|
28
33
|
json (1.8.1)
|
29
|
-
minitest (5.3.
|
30
|
-
rake (10.3.
|
31
|
-
rspec (
|
32
|
-
rspec-core (~>
|
33
|
-
rspec-expectations (~>
|
34
|
-
rspec-mocks (~>
|
35
|
-
rspec-core (
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
minitest (5.3.4)
|
35
|
+
rake (10.3.2)
|
36
|
+
rspec (3.0.0)
|
37
|
+
rspec-core (~> 3.0.0)
|
38
|
+
rspec-expectations (~> 3.0.0)
|
39
|
+
rspec-mocks (~> 3.0.0)
|
40
|
+
rspec-core (3.0.1)
|
41
|
+
rspec-support (~> 3.0.0)
|
42
|
+
rspec-expectations (3.0.1)
|
43
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
44
|
+
rspec-support (~> 3.0.0)
|
45
|
+
rspec-mocks (3.0.1)
|
46
|
+
rspec-support (~> 3.0.0)
|
47
|
+
rspec-support (3.0.0)
|
39
48
|
sqlite3 (1.3.9)
|
40
49
|
sqlite3-ruby (1.3.3)
|
41
50
|
sqlite3 (>= 1.3.3)
|
42
|
-
thread_safe (0.3.
|
43
|
-
tzinfo (1.1
|
51
|
+
thread_safe (0.3.4)
|
52
|
+
tzinfo (1.2.1)
|
44
53
|
thread_safe (~> 0.1)
|
45
54
|
|
46
55
|
PLATFORMS
|
@@ -48,6 +57,7 @@ PLATFORMS
|
|
48
57
|
|
49
58
|
DEPENDENCIES
|
50
59
|
association_callbacks!
|
60
|
+
byebug (~> 3.1.0)
|
51
61
|
rake (~> 10.3.0)
|
52
|
-
rspec (~>
|
62
|
+
rspec (~> 3.0.0)
|
53
63
|
sqlite3-ruby (~> 1.3.0)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
@@ -19,7 +19,8 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.add_dependency 'activerecord', '~> 4.1.0'
|
20
20
|
s.add_dependency 'activesupport', '~> 4.1.0'
|
21
21
|
|
22
|
+
s.add_development_dependency 'byebug', '~> 3.1.0'
|
22
23
|
s.add_development_dependency 'rake', '~> 10.3.0'
|
23
|
-
s.add_development_dependency 'rspec', '~>
|
24
|
+
s.add_development_dependency 'rspec', '~> 3.0.0'
|
24
25
|
s.add_development_dependency 'sqlite3-ruby', '~> 1.3.0'
|
25
26
|
end
|
@@ -16,7 +16,7 @@ describe AssociationCallbacks::ActiveRecord do
|
|
16
16
|
expect {
|
17
17
|
Comment.create!(post: post, created_at: 2.years.ago)
|
18
18
|
}.to change { post.reload.last_comment_at }.from(nil)
|
19
|
-
post.last_comment_at.to_i.
|
19
|
+
expect(post.last_comment_at.to_i).to be_within(5).of(2.years.ago.to_i)
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'invokes callback defines as block' do
|
@@ -44,7 +44,7 @@ describe AssociationCallbacks::ActiveRecord do
|
|
44
44
|
expect {
|
45
45
|
post.update_attributes!(title: 'foo')
|
46
46
|
}.to change { comment.reload.post_updated_at }
|
47
|
-
comment.post_updated_at.to_i.
|
47
|
+
expect(comment.post_updated_at.to_i).to be_within(5).of(Time.now.to_i)
|
48
48
|
end
|
49
49
|
|
50
50
|
it 'invokes callback defines as method (with one argument)' do
|
@@ -5,11 +5,11 @@ describe AssociationCallbacks do
|
|
5
5
|
describe '.version' do
|
6
6
|
|
7
7
|
it 'is a string' do
|
8
|
-
AssociationCallbacks.version.
|
8
|
+
expect(AssociationCallbacks.version).to be_a(String)
|
9
9
|
end
|
10
10
|
|
11
11
|
it 'is with correct format' do
|
12
|
-
AssociationCallbacks.version.
|
12
|
+
expect(AssociationCallbacks.version).to match(/^\d+\.\d+(\.\d+)?$/)
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'is freezed' do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
ENV[
|
1
|
+
ENV['RAILS_ENV'] ||= 'test'
|
2
2
|
|
3
3
|
require File.expand_path("#{__dir__}/../lib/association_callbacks")
|
4
|
+
require 'byebug'
|
4
5
|
|
5
6
|
# Support
|
6
7
|
Dir["#{__dir__}/support/**/*.rb"].each { |f| require f }
|
@@ -13,4 +14,6 @@ RSpec.configure do |config|
|
|
13
14
|
Comment.delete_all
|
14
15
|
Post.delete_all
|
15
16
|
end
|
17
|
+
|
18
|
+
config.raise_errors_for_deprecations!
|
16
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: association_callbacks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Toulotte
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 4.1.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: byebug
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.1.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.1.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +72,14 @@ dependencies:
|
|
58
72
|
requirements:
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
75
|
+
version: 3.0.0
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
82
|
+
version: 3.0.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: sqlite3-ruby
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|