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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eea6fceef4486786190a225cbc9bed5eb085df59
4
- data.tar.gz: fe8160fcbd9a2a8c363e3775448125c4c5066bb3
3
+ metadata.gz: 2c192144587fb6b1cf355082c7cad4a68f4b3e0b
4
+ data.tar.gz: a40ee641ff492b1123cea2fd9242feec6b5ed728
5
5
  SHA512:
6
- metadata.gz: e25ab420786e572ddd640aee45f2c829a60feb4bbed053690f1fe8877eb320203bec1d428657203551242cdedaf8e3bc3a2020e1920aa495b7165f11de4b74a2
7
- data.tar.gz: 3fcbe7e7877fd07be90bfce405351d90d59d6005b5a2003fc7fd6caee8c9e418512f9a3e50eb46df4fe73a21e501efb560111d2b6b1fffe3ddca5cbb47bbcf3c
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
@@ -1,5 +1,9 @@
1
1
  module Crm
2
2
  module Helper
3
- include Crm::Helpers::Attributes
3
+ def self.included(base)
4
+ base.include Crm::Helpers::Attributes
5
+ base.include Crm::Helpers::Finders
6
+ base.include Crm::Helpers::Persistence
7
+ end
4
8
  end
5
9
  end
@@ -95,10 +95,19 @@ module Crm
95
95
  end
96
96
  end
97
97
 
98
- def assign_attributes(new_attributes)
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
- assign_attributes(attributes)
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
- assign_attributes(attributes)
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
- assign_attributes(crm_object.attributes)
53
+ assign_crm_attributes(crm_object.attributes)
54
54
  true
55
55
  end
56
56
 
@@ -1,5 +1,5 @@
1
1
  module Crm
2
2
  module Helpers
3
- VERSION = '1.1.0'.freeze
3
+ VERSION = '1.1.1'.freeze
4
4
  end
5
5
  end
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.0
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-02 00:00:00.000000000 Z
11
+ date: 2016-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport