active_tools 0.0.29 → 0.0.30

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: f2895e755290fdee6deebf87759443fe717e95de
4
- data.tar.gz: 9d2b4743a87b380f67c715a5f67e914385dfb186
3
+ metadata.gz: f36877ba1612f7582251d82e3e92b6fa6da7d984
4
+ data.tar.gz: e590d9d69a3851187404b6d3e1b6174be2de860d
5
5
  SHA512:
6
- metadata.gz: 5525fe85bda2749a3114c353a4a84b3e7b6f5aa2f90bc6032796cf78a576625cf02e947a95fdc99d0bb67d06123c73de8535181e2776315a7b536e024241933b
7
- data.tar.gz: 1bbcc9e184b7fd90d587b85a8a1307c629ca41bfccb82793a5794b01016422fc0c6d36fb5a104b6588f5bfa11fd157e01abbaff3602eb2bf9c17e06309c33785
6
+ metadata.gz: dc1308828f61e57c76f01a5a8e7c6bae3edf10d0fde92d675235c6d0a1c9e066f51a4cbdc7f15143a7e6b5dea9f08efdf532cec57b3cb64f6b05112a871e6056
7
+ data.tar.gz: c9ec0279cae626e6032a89c378ca167a9803b0faf9d3819b62b64aaec90d08a23c37bb9f15b57813edfcffa6ca079f2d21ba547be9f9fa6da9bb7a431228eacd
@@ -63,7 +63,7 @@ module ActiveTools
63
63
  self.adaptive_options[assoc_name.to_sym] = options.merge(:remote_attributes => attr_map.keys)
64
64
 
65
65
  class_eval <<-EOV
66
- after_validation do
66
+ before_validation do
67
67
  #{adapter_name}.try_nullify
68
68
  #{adapter_name}.try_commit
69
69
  end
@@ -15,9 +15,11 @@ module ActiveTools
15
15
  cattr_accessor :with_permalink_options unless defined?(with_permalink_options)
16
16
  self.with_permalink_options ||= {}
17
17
  self.with_permalink_options[column_name] = options
18
-
18
+
19
+ uniqueness_options = options[:scope] ? {:scope => Array(options[:scope])} : {}
20
+
19
21
  validates_presence_of column_name
20
- validates_uniqueness_of column_name, options[:scope] ? {:scope => Array(options[:scope])} : {}
22
+ validates_uniqueness_of column_name, uniqueness_options
21
23
 
22
24
  before_validation do
23
25
  self.with_permalink_options.each do |column_name, options|
@@ -1,3 +1,3 @@
1
1
  module ActiveTools
2
- VERSION = "0.0.29"
2
+ VERSION = "0.0.30"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.29
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valery Kvon