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.
@@ -68,6 +68,7 @@ module Ardb
68
68
  :before_update, :around_update, :after_update,
69
69
  :before_save, :around_save, :after_save,
70
70
  :before_destroy, :around_destroy, :after_destroy,
71
+ :after_commit, :after_rollback,
71
72
  :after_initialize, :after_find
72
73
  ].each do |method_name|
73
74
 
data/lib/ardb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ardb
2
- VERSION = "0.10.0"
2
+ VERSION = "0.11.0"
3
3
  end
@@ -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 with #validates_presence_of" do
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 #validates_associated" do
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 #after_initialize" do
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 #before_validation" do
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: 55
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 10
8
+ - 11
9
9
  - 0
10
- version: 0.10.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-06-24 00:00:00 Z
19
+ date: 2013-09-25 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: assert