active_tools 0.0.38 → 0.0.39
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89aae5bfc10620868e8c1c02ef12d75818c85838
|
4
|
+
data.tar.gz: 7f736e8e7570394a8fb02e23ba0cce357d659730
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4bab0a33a7d2d754e5235f8d432ed769756b69975356f43105806fec231acb18c4ef34d477e36ff193a4c3fb8969fa84bfd08de74d1fb1f9044d363f464a524
|
7
|
+
data.tar.gz: b03fd9a5e44114126dc7fea19d807b2d32b626394c37d35b70f969cd1945f19aaa72741b8ec897895946d7138b775b7b686df9d6fe26f901daf14567098351b5
|
@@ -11,7 +11,8 @@ module ActiveTools
|
|
11
11
|
@assoc_name = assoc_name
|
12
12
|
@options = options.with_indifferent_access
|
13
13
|
@foreign_key = reflection.foreign_key
|
14
|
-
@
|
14
|
+
@attr_map = @options[:attr_map]
|
15
|
+
@remote_attributes = @attr_map.keys
|
15
16
|
@init_proc = @options[:init_proc]
|
16
17
|
@nullify_if = @options[:nullify_if]
|
17
18
|
@update_if = @options[:update_if]
|
@@ -35,12 +36,13 @@ module ActiveTools
|
|
35
36
|
|
36
37
|
def write(name, value)
|
37
38
|
valid_attribute?(name)
|
39
|
+
local_attribute = @attr_map[name]
|
38
40
|
if value != read(name)
|
39
|
-
owner.send(:attribute_will_change!,
|
41
|
+
owner.send(:attribute_will_change!, local_attribute)
|
40
42
|
store_backup!
|
41
43
|
create_template!
|
42
44
|
target.send("#{name}=", value)
|
43
|
-
owner.send(:clear_attribute_changes,
|
45
|
+
owner.send(:clear_attribute_changes, local_attribute) if owner.changes[local_attribute].try(:last) == owner.changes[local_attribute].try(:first)
|
44
46
|
if @backup.present? && same_records?(@backup, target, :attributes => @remote_attributes)
|
45
47
|
restore_backup!
|
46
48
|
end
|
data/lib/active_tools/version.rb
CHANGED
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.
|
4
|
+
version: 0.0.39
|
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-02-
|
11
|
+
date: 2016-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|