active_tools 0.0.42 → 0.0.50

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: ba8ba14a82984307a6081f2a20507ee4ccecde7c
4
- data.tar.gz: 489278d3bbffeb1257620a3452250ea0344a0699
3
+ metadata.gz: 2fed305b8948e972bfa8d49c0d9bcbb10719c249
4
+ data.tar.gz: 2af83ee21be57d34ec36368ce65a00ec331d4ca6
5
5
  SHA512:
6
- metadata.gz: 5408dcf031288e648c0f3b65d534f85bbe8642f4a88db7a1f7d5e943a6ebedba06dbf73b2de62d3fffba6d6653e703c8bef5e028c113e22ca9c88027b36a09ec
7
- data.tar.gz: 2e74b6e687eb0f0599c01d9680f06a6695f2acdb2979624900c796199149813542c08c824b34c9e724c00bdc189f872c56da98f1fc366bec2d905084bef58359
6
+ metadata.gz: ae3f3d27967889287e0b28102b6d1154d3480c7deff13d426151923416abc56ca3bb4e9a06347ee1a6e679747aaae809a310000d3aeb39312a291333c1ee6f45
7
+ data.tar.gz: 2dc855f78c179f89914d581997f92f65708279b373eab60e77cff7cf126a72d72e7f2dfaa71f048f00ac221ddc8d97086962a9da36daa8e6aa59b4e38ad0f9ab
@@ -50,9 +50,10 @@ module ActiveTools
50
50
  end
51
51
 
52
52
  def try_nullify
53
- if nullify?
53
+ if nullify_target?
54
54
  store_backup!
55
55
  self.target = nil
56
+ true
56
57
  end
57
58
  end
58
59
 
@@ -158,7 +159,7 @@ module ActiveTools
158
159
  klass.includes(outer_values).where(where_values).limit(1).first
159
160
  end
160
161
 
161
- def nullify?
162
+ def nullify_target?
162
163
  target.present? && @nullify_if.try(:call, (target.persisted? ? target.reload : target), owner)
163
164
  end
164
165
 
@@ -64,8 +64,7 @@ module ActiveTools
64
64
 
65
65
  class_eval <<-EOV
66
66
  before_validation do
67
- #{adapter_name}.try_nullify
68
- #{adapter_name}.try_commit
67
+ #{adapter_name}.try_nullify||#{adapter_name}.try_commit
69
68
  end
70
69
 
71
70
  after_save do
@@ -1,3 +1,3 @@
1
1
  module ActiveTools
2
- VERSION = "0.0.42"
2
+ VERSION = "0.0.50"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.42
4
+ version: 0.0.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valery Kvon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-09 00:00:00.000000000 Z
11
+ date: 2016-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails