ardb 0.10.0 → 0.11.0
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.
- data/lib/ardb/record_spy.rb +1 -0
- data/lib/ardb/version.rb +1 -1
- data/test/unit/record_spy_tests.rb +5 -4
- metadata +4 -4
data/lib/ardb/record_spy.rb
CHANGED
data/lib/ardb/version.rb
CHANGED
@@ -29,6 +29,7 @@ module Ardb::RecordSpy
|
|
29
29
|
should have_imeths :before_update, :around_update, :after_update
|
30
30
|
should have_imeths :before_save, :around_save, :after_save
|
31
31
|
should have_imeths :before_destroy, :around_destroy, :after_destroy
|
32
|
+
should have_imeths :after_commit, :after_rollback
|
32
33
|
should have_imeths :after_initialize, :after_find
|
33
34
|
|
34
35
|
should "included the record spy instance methods" do
|
@@ -59,7 +60,7 @@ module Ardb::RecordSpy
|
|
59
60
|
assert_equal 'Linking', association.options[:class_name]
|
60
61
|
end
|
61
62
|
|
62
|
-
should "add a validation config
|
63
|
+
should "add a validation config for '*_of' validations" do
|
63
64
|
subject.validates_presence_of :name, :email, :on => :create
|
64
65
|
validation = subject.validations.last
|
65
66
|
assert_equal :presence, validation.type
|
@@ -76,7 +77,7 @@ module Ardb::RecordSpy
|
|
76
77
|
assert_includes :linkings, validation.associations
|
77
78
|
end
|
78
79
|
|
79
|
-
should "add a validation config with #
|
80
|
+
should "add a validation config with #validates_with" do
|
80
81
|
first_validation_class = Class.new
|
81
82
|
second_validation_class = Class.new
|
82
83
|
subject.validates_with first_validation_class, second_validation_class
|
@@ -109,14 +110,14 @@ module Ardb::RecordSpy
|
|
109
110
|
assert_equal block, validation.block
|
110
111
|
end
|
111
112
|
|
112
|
-
should "add a callback config with
|
113
|
+
should "add a callback config with with a method name" do
|
113
114
|
subject.after_initialize :a_callback_method
|
114
115
|
callback = subject.callbacks.last
|
115
116
|
assert_equal :after_initialize, callback.type
|
116
117
|
assert_includes :a_callback_method, callback.args
|
117
118
|
end
|
118
119
|
|
119
|
-
should "add a callback config with
|
120
|
+
should "add a callback config with a block" do
|
120
121
|
subject.before_validation(:on => :create) do
|
121
122
|
self.name = 'test'
|
122
123
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ardb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 11
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.11.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2013-
|
19
|
+
date: 2013-09-25 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: assert
|