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 +4 -4
- data/Gemfile.lock +13 -13
- data/lib/civicrm/resources/base.rb +1 -3
- data/lib/civicrm/resources/custom_field.rb +35 -0
- data/lib/civicrm/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d1e22467572fa4a10aab4c6b6b8157e96852360
|
4
|
+
data.tar.gz: 7f0b3c4dd46f8efb262986cd6e776a54e395b26d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fcd6eb9f260b376e4320b4422e1b62844c5f7517f404bcca4741c64375e6e2bf084dec5ce6a1382e38aed36254b782231c646c73c64f7c32fcbeebf3eb25cbc
|
7
|
+
data.tar.gz: db4d6103cd428f6161c390a1ccc6069016de346733f1f93ac9db8795d9b4fe351a574ea479144a7c55b9f14b63c0646b709e65bbb3ad6115c7877cfd5040eabe
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
civicrm (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.
|
14
|
-
activesupport (= 5.2.
|
15
|
-
activesupport (5.2.
|
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.
|
21
|
+
concurrent-ruby (1.1.5)
|
22
22
|
diff-lcs (1.3)
|
23
|
-
domain_name (0.5.
|
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.
|
27
|
+
i18n (1.7.0)
|
28
28
|
concurrent-ruby (~> 1.0)
|
29
|
-
mime-types (3.
|
29
|
+
mime-types (3.2.2)
|
30
30
|
mime-types-data (~> 3.2015)
|
31
|
-
mime-types-data (3.
|
31
|
+
mime-types-data (3.2019.0331)
|
32
32
|
mini_portile2 (2.4.0)
|
33
|
-
minitest (5.
|
33
|
+
minitest (5.12.2)
|
34
34
|
netrc (0.11.0)
|
35
|
-
nokogiri (1.10.
|
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.
|
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
|
-
|
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
|
data/lib/civicrm/version.rb
CHANGED
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.
|
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:
|
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
|