pinkman 1.4.5 → 1.5.0

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
  SHA256:
3
- metadata.gz: d54a63a8ebb95cb3d0acce83d79aa979668b50c5ea60005e4baa39d8cdc351ac
4
- data.tar.gz: b0c3a8143f4b20d710302ea5ac6826697184cce4b5a92489db1af224dc063578
3
+ metadata.gz: fa1bf2864f22809f8c499dc3437a155460de8f51a24c7c8b37b96b404545ffe7
4
+ data.tar.gz: 0a2f8064c7976a7e1e531aa07dad167a847e6bd39a782aa0e598cbbd47c4b517
5
5
  SHA512:
6
- metadata.gz: 5d1b8afbbaecade562f1cd9776c069b7b991343ea74beab91b6af5fe21eeb7b9c5a0c3929db2acb0c1f66d38536bd2371bd66ce94b47fe67ec11c3a282f771ed
7
- data.tar.gz: 158438e42ba3f6de9b75f52335b7f552da35a9665e318a1ab9c6a5690b85823ea8593175cbd59fcae775d88703b43d5468e4f932ac9e2e64a622cd390c80519b
6
+ metadata.gz: 0e3bf8479041f58f137d70ac296cb7f353db73e1ac73bd4fa912748da5dfde4096b099091498b0d24e474f75609929ffc0d8ff500b5acbb099827fe9f3fe6129
7
+ data.tar.gz: 93710f4576d813674cfde8feb99420c0cd4f1a0739f13135a373baa621817c95f9affc15a60b8b50b96b3eb48d64ed8e1b90fd4e451cb9fa9f02432eaaa3ad60
@@ -62,17 +62,25 @@ class window.PinkmanObject extends window.PinkmanCommon
62
62
  (@pack(toBePacked) for toBePacked in @_pack_list) if $p.isArray(@_pack_list)
63
63
  a = new Object
64
64
  for k,v of this
65
- a[k] = v if PinkmanObject.privateAttributes.indexOf(k) == -1 and not $p.isFunction(v) and not $p.isObject(v)
65
+ a[k] = v if PinkmanObject.privateAttributes.indexOf(k) == -1 and not $p.isFunction(v) and (not $p.isObject(v) or $p.isArray(v)) and k[0] != '_'
66
+ #
67
+ # else
68
+ # console.log "recusou: #{k}"
66
69
  return a
67
70
 
68
71
  # Desc: prepare for rails accept nested attributes
69
72
  pack: (attr) ->
73
+ # console.log 'tá pegando'
70
74
  @_pack_list = [] unless @_pack_list?
71
75
  @_pack_list.push(attr) if @_pack_list.indexOf(attr) == -1
72
76
  if $p.isPink(this[attr])
73
77
  pack = this[attr]
74
78
  attrs = pack.json()
75
- @set("#{attr}_attributes[#{k}]", v) for k,v of attrs
79
+ if pack.isCollection
80
+ # console.log 'entrou pra collection'
81
+ @set("#{attr}_attributes", pack.json())
82
+ else
83
+ @set("#{attr}_attributes[#{k}]", v) for k,v of attrs
76
84
  attrs
77
85
 
78
86
  # Desc: returns a array of attributes keys
@@ -1,3 +1,3 @@
1
1
  module Pinkman
2
- VERSION = "1.4.5"
2
+ VERSION = "1.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pinkman
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agilso Oliveira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-22 00:00:00.000000000 Z
11
+ date: 2020-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler