infopark-crm-helpers 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/changelog.md +5 -0
- data/lib/crm/helper.rb +5 -1
- data/lib/crm/helpers/attributes.rb +10 -1
- data/lib/crm/helpers/persistence.rb +3 -3
- data/lib/crm/helpers/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c192144587fb6b1cf355082c7cad4a68f4b3e0b
|
4
|
+
data.tar.gz: a40ee641ff492b1123cea2fd9242feec6b5ed728
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 398b0c2fc30b0796e1bd7536e2d958ab226e77631cb6b970e4ee9ad98cdb0b8c429bfa1fa48fffe06755a5d4a68fcc8a20e288054eadfcc358873142da273732
|
7
|
+
data.tar.gz: 64509c7bd567d8ab5de32f1c8858e08aeea8bcbb8382c4861eb68077b2a257001e05bf0d19405103d79df5af1a6bab75373a94c2c8fe0a675903fc5fc1de13d0
|
data/changelog.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
### 1.1.1
|
2
|
+
|
3
|
+
- Include `Crm::Helpers::Finders` and `Crm::Helpers::Persistence` automagically when including `Crm::Helper`.
|
4
|
+
- Rename `assign_attributes` to `assign_crm_attributes`, deprecating `assign_attributes` in the near future.
|
5
|
+
|
1
6
|
### 1.1.0
|
2
7
|
|
3
8
|
- Add `assign_attributes` to `Crm::Helpers::Attributes`.
|
data/lib/crm/helper.rb
CHANGED
@@ -95,10 +95,19 @@ module Crm
|
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
98
|
-
def
|
98
|
+
def assign_crm_attributes(new_attributes)
|
99
99
|
@crm_attributes = crm_attributes.merge(new_attributes)
|
100
100
|
end
|
101
101
|
|
102
|
+
def assign_attributes(new_attributes)
|
103
|
+
deprecation_message = '[DEPRECATION] '
|
104
|
+
deprecation_message << '`Crm::Helpers::Attributes#assign_attributes` is deprecated. '
|
105
|
+
deprecation_message << 'Please use `Crm::Helpers::Attributes#last_description` instead. '
|
106
|
+
deprecation_message << '`Crm::Helpers::Attributes#assign_attributes` will be removed in version 2.0.0.'
|
107
|
+
STDERR.puts(deprecation_message)
|
108
|
+
assign_crm_attributes(new_attributes)
|
109
|
+
end
|
110
|
+
|
102
111
|
def crm_attributes
|
103
112
|
@crm_attributes ||= {}
|
104
113
|
end
|
@@ -24,14 +24,14 @@ module Crm
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def update(attributes = {})
|
27
|
-
|
27
|
+
assign_crm_attributes(attributes)
|
28
28
|
return false if invalid?
|
29
29
|
|
30
30
|
persist
|
31
31
|
end
|
32
32
|
|
33
33
|
def update!(attributes = {})
|
34
|
-
|
34
|
+
assign_crm_attributes(attributes)
|
35
35
|
raise "#{self.class.name} object is invalid." if invalid?
|
36
36
|
|
37
37
|
persist
|
@@ -50,7 +50,7 @@ module Crm
|
|
50
50
|
else
|
51
51
|
crm_object.update(crm_attributes)
|
52
52
|
end
|
53
|
-
|
53
|
+
assign_crm_attributes(crm_object.attributes)
|
54
54
|
true
|
55
55
|
end
|
56
56
|
|
data/lib/crm/helpers/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infopark-crm-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Huy Dinh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|