forest_liana 1.5.26 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e10fb37e3554d0a652638aa39a36221d09c04880
|
|
4
|
+
data.tar.gz: 3d82a9ba7233208a1438631a19ec8bc69e41ddc7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 797774dbc3550155a4285a2c470736dd0355a671e9d3774b99cbf119188b5144fd72bdc036efe6e381d469e59eb580df5bf8d3bd75fc6b618b46230e81ed61dc
|
|
7
|
+
data.tar.gz: 75b6d4ce3e0cad95d3dc8ffec29cc37eecadbdf46998122d9bf32bcced23e26c6f2e633382bd30d9cb13bc90dbfcdb234b3d77a884e018554e2092321e382982
|
|
@@ -16,6 +16,7 @@ module ForestLiana
|
|
|
16
16
|
extract_paperclip
|
|
17
17
|
extract_carrierwave
|
|
18
18
|
extract_acts_as_taggable
|
|
19
|
+
extract_smart_fields_values
|
|
19
20
|
|
|
20
21
|
@attributes
|
|
21
22
|
end
|
|
@@ -117,6 +118,17 @@ module ForestLiana
|
|
|
117
118
|
end
|
|
118
119
|
end
|
|
119
120
|
|
|
121
|
+
def extract_smart_fields_values
|
|
122
|
+
# NOTICE: Look for some Smart Field setters and apply them if any.
|
|
123
|
+
ForestLiana.schema_for_resource(@resource).fields.each do |field|
|
|
124
|
+
if field.try(:[], :set)
|
|
125
|
+
# WARNING: The Smart Fields setters may override other changes.
|
|
126
|
+
@attributes = field[:set].call(@attributes,
|
|
127
|
+
@params['data']['attributes'][field[:field]])
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
120
132
|
def paperclip_handler?(attr)
|
|
121
133
|
begin
|
|
122
134
|
Paperclip.io_adapters.handler_for(attr)
|
|
@@ -15,7 +15,7 @@ module ForestLiana
|
|
|
15
15
|
@records = belongs_to_filter
|
|
16
16
|
|
|
17
17
|
if @params[:search]
|
|
18
|
-
|
|
18
|
+
ForestLiana.schema_for_resource(@resource).fields.each do |field|
|
|
19
19
|
if field.try(:[], :search)
|
|
20
20
|
@records = field[:search].call(@records, @params[:search])
|
|
21
21
|
end
|
|
@@ -202,9 +202,5 @@ module ForestLiana
|
|
|
202
202
|
|
|
203
203
|
@records
|
|
204
204
|
end
|
|
205
|
-
|
|
206
|
-
def schema
|
|
207
|
-
ForestLiana.apimap.find {|x| x.name == @resource.table_name}
|
|
208
|
-
end
|
|
209
205
|
end
|
|
210
206
|
end
|
data/lib/forest_liana.rb
CHANGED
data/lib/forest_liana/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: forest_liana
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sandro Munda
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-04-
|
|
11
|
+
date: 2017-04-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|