civicrm 1.3.1 → 1.3.2

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: 08213b07d9c509cce9fde6eb2cd6d172beae1e29
4
- data.tar.gz: b950d8fa3aadcf8228d4eef6e62f577e7ff9834e
3
+ metadata.gz: 0d1e22467572fa4a10aab4c6b6b8157e96852360
4
+ data.tar.gz: 7f0b3c4dd46f8efb262986cd6e776a54e395b26d
5
5
  SHA512:
6
- metadata.gz: 0aa4ebfeba87a0981584b219e73f7edf2459d5974ff342d3b8b8f842e0b5064933b9f2c1c74537ad69437cfef5dbd903605b03f31462a0abda4ee41d30fac124
7
- data.tar.gz: 6acbe76caea2a07a6294bdd7cccf402eac2868d04de16693a6640e22e6f4356a7dc779c3d1c2f1fc60bfa712c2e0895b26b522f22f4425ff62f399af7415e255
6
+ metadata.gz: 3fcd6eb9f260b376e4320b4422e1b62844c5f7517f404bcca4741c64375e6e2bf084dec5ce6a1382e38aed36254b782231c646c73c64f7c32fcbeebf3eb25cbc
7
+ data.tar.gz: db4d6103cd428f6161c390a1ccc6069016de346733f1f93ac9db8795d9b4fe351a574ea479144a7c55b9f14b63c0646b709e65bbb3ad6115c7877cfd5040eabe
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- civicrm (1.1.1)
4
+ civicrm (1.3.2)
5
5
  activemodel
6
6
  activesupport
7
7
  nokogiri
@@ -10,29 +10,29 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activemodel (5.2.1)
14
- activesupport (= 5.2.1)
15
- activesupport (5.2.1)
13
+ activemodel (5.2.3)
14
+ activesupport (= 5.2.3)
15
+ activesupport (5.2.3)
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
17
  i18n (>= 0.7, < 2)
18
18
  minitest (~> 5.1)
19
19
  tzinfo (~> 1.1)
20
20
  byebug (10.0.2)
21
- concurrent-ruby (1.1.4)
21
+ concurrent-ruby (1.1.5)
22
22
  diff-lcs (1.3)
23
- domain_name (0.5.20180417)
23
+ domain_name (0.5.20190701)
24
24
  unf (>= 0.0.5, < 1.0.0)
25
25
  http-cookie (1.0.3)
26
26
  domain_name (~> 0.5)
27
- i18n (1.1.1)
27
+ i18n (1.7.0)
28
28
  concurrent-ruby (~> 1.0)
29
- mime-types (3.1)
29
+ mime-types (3.2.2)
30
30
  mime-types-data (~> 3.2015)
31
- mime-types-data (3.2016.0521)
31
+ mime-types-data (3.2019.0331)
32
32
  mini_portile2 (2.4.0)
33
- minitest (5.11.3)
33
+ minitest (5.12.2)
34
34
  netrc (0.11.0)
35
- nokogiri (1.10.1)
35
+ nokogiri (1.10.4)
36
36
  mini_portile2 (~> 2.4.0)
37
37
  rake (10.0.3)
38
38
  rest-client (2.0.2)
@@ -57,7 +57,7 @@ GEM
57
57
  thread_safe (~> 0.1)
58
58
  unf (0.1.4)
59
59
  unf_ext
60
- unf_ext (0.0.7.5)
60
+ unf_ext (0.0.7.6)
61
61
 
62
62
  PLATFORMS
63
63
  ruby
@@ -69,4 +69,4 @@ DEPENDENCIES
69
69
  rspec (~> 3.8)
70
70
 
71
71
  BUNDLED WITH
72
- 1.12.5
72
+ 2.0.1
@@ -50,9 +50,6 @@ module CiviCrm
50
50
  class Country < BaseResource
51
51
  entity :country
52
52
  end
53
- class CustomField < BaseResource
54
- entity :custom_field
55
- end
56
53
  class CustomGroup < BaseResource
57
54
  entity :custom_group
58
55
  end
@@ -157,5 +154,6 @@ module CiviCrm
157
154
  end
158
155
  end
159
156
 
157
+ require "civicrm/resources/custom_field"
160
158
  require "civicrm/resources/financial_type"
161
159
  require "civicrm/resources/option_value"
@@ -0,0 +1,35 @@
1
+ module CiviCrm
2
+ class CustomField < BaseResource
3
+ entity :custom_field
4
+
5
+ @@_custom_field_cache = {}
6
+
7
+ def self.[](entity, field, cache: true)
8
+ cache_key = name
9
+
10
+ if cache && @@_custom_field_cache.key?(cache_key)
11
+ return @@_custom_field_cache[cache_key]
12
+ end
13
+
14
+ field = find_by(
15
+ "custom_group_id.extends" => entity,
16
+ "custom_group_id.name" => entity,
17
+ "name" => field,
18
+ "options" => { "or" => [["custom_group_id.extends", "custom_group_id.name"]] }
19
+ )
20
+
21
+ if field
22
+ @@_custom_field_cache[cache_key] = field if cache
23
+ return field
24
+ end
25
+
26
+ raise Errors::NotFound.new(
27
+ "CustomField of #{entity} with name=#{name}"
28
+ )
29
+ end
30
+
31
+ def key
32
+ "custom_#{id}"
33
+ end
34
+ end
35
+ end
@@ -1,3 +1,3 @@
1
1
  module CiviCrm
2
- VERSION = '1.3.1'
2
+ VERSION = '1.3.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: civicrm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Haziev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-17 00:00:00.000000000 Z
11
+ date: 2020-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -139,6 +139,7 @@ files:
139
139
  - lib/civicrm/profiling.rb
140
140
  - lib/civicrm/resource.rb
141
141
  - lib/civicrm/resources/base.rb
142
+ - lib/civicrm/resources/custom_field.rb
142
143
  - lib/civicrm/resources/financial_type.rb
143
144
  - lib/civicrm/resources/option_value.rb
144
145
  - lib/civicrm/version.rb