forest_liana 2.3.2 → 2.3.3

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: 27d8c4b801ffd99f1e45f19ab947ef6be82f08aa
4
- data.tar.gz: 8d144c4bd2e9ce12d831b83e00e4669b278ce1b3
3
+ metadata.gz: '046176008e331d0d0ef0f719a898e070a834b667'
4
+ data.tar.gz: 228a5457c46e11389e6fb87cee5d811df508b2a2
5
5
  SHA512:
6
- metadata.gz: 32a504461a34ed3dff3b4c0408703165529e4e36d10902ed80a5f566bdafe13055d917214e7bf7cbb7da60a1312e1f867e2f04c5ab6b76d5d591c07c06284a8b
7
- data.tar.gz: a16c84efcc9ce9b1778433df4df2f633b851ea1c01034926a4e4ff32b7d756339f1441e4d80314bc8f47e6ba7fd85f6c0506fca344c3143a2a87492b8eaf147a
6
+ metadata.gz: 71402998da21e786c5dd6d8a70b8f025cd92335ba266fb459c809e003ad55d99636457ef99eeaa03bcf2f567e918ea474209a3d67cba441319f774e216715c64
7
+ data.tar.gz: 730998341e1be2728267a5cfc91d160205ed0aff5958d98fa374b84c0a0e227f2cbc6515eea3dd4a6417f0da661e42c519e554675bfe801ce1dcd135d8013208
@@ -17,6 +17,7 @@ module ForestLiana
17
17
  extract_carrierwave
18
18
  extract_acts_as_taggable
19
19
  extract_smart_fields_values
20
+ extract_devise
20
21
 
21
22
  @attributes
22
23
  end
@@ -137,6 +138,17 @@ module ForestLiana
137
138
  end
138
139
  end
139
140
 
141
+ def extract_devise
142
+ return if @params['data']['attributes'].blank?
143
+ return unless has_devise?
144
+
145
+ if @params['data']['attributes']['password'] == '**********'
146
+ @params['data']['attributes'].delete('password')
147
+ else
148
+ @attributes['password'] = @params['data']['attributes']['password']
149
+ end
150
+ end
151
+
140
152
  def paperclip_handler?(attr)
141
153
  begin
142
154
  Paperclip.io_adapters.handler_for(attr)
@@ -177,5 +189,9 @@ module ForestLiana
177
189
  @resource.respond_to?(:acts_as_taggable) &&
178
190
  @resource.acts_as_taggable.respond_to?(:to_a)
179
191
  end
192
+
193
+ def has_devise?
194
+ @resource.respond_to?(:devise_modules?)
195
+ end
180
196
  end
181
197
  end
@@ -203,6 +203,13 @@ module ForestLiana
203
203
  end
204
204
  end
205
205
 
206
+ # NOTICE: Format Devise attributes
207
+ if active_record_class.respond_to?(:devise_modules?)
208
+ serializer.attribute('password') do |x|
209
+ '**********'
210
+ end
211
+ end
212
+
206
213
  SchemaUtils.associations(active_record_class).each do |a|
207
214
  begin
208
215
  if SchemaUtils.model_included?(a.klass)
@@ -37,8 +37,10 @@ module ForestLiana
37
37
  }]
38
38
  })
39
39
 
40
- collection.fields.delete_if do |f|
41
- ['encrypted_password'].include?(f[:field])
40
+ collection.fields.each do |field|
41
+ if field[:field] == 'encrypted_password'
42
+ field[:field] = 'password'
43
+ end
42
44
  end
43
45
  end
44
46
 
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "2.3.2"
2
+ VERSION = "2.3.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.2
4
+ version: 2.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda