pinkman 0.9.1.21 → 0.9.1.23

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: 64eca2859d508df91d804bf596ab1aca05400dcd
4
- data.tar.gz: c7a85f7e7b4e6002640f4293704221c15d2e35fb
3
+ metadata.gz: 1783e5a5c20b525c29e2a72315385c50677604dc
4
+ data.tar.gz: e77f236792e02c18b72175932f832f879e51df34
5
5
  SHA512:
6
- metadata.gz: 559dd223497f1acdf6e617120b66a986daac4ca3757e6bd2fc3a9febb096a081625a825d6497995c0b5497aa934ed993e05bc9e5249d7344ddb934e567c726dc
7
- data.tar.gz: 37b9b2fdf2e717934a90fb60d0ea21e82f80b8118ecc6ca7b0f941418b805d302483ccf1846ca4081bb74e463c4526fb679e8b4513006e739b60fef0fb24582f
6
+ metadata.gz: 768bfcc52e5f49fa7d5a2ca6db2515fcab2b2fe97e61de57a3c9d10bf97459bd6492f2ee38a8372399b3669a5488cd7d53e7e0a149bdcc3714c30ec8c959154d
7
+ data.tar.gz: 4db65212d133e2769f2519bdc9023119d0f269d831068599d26d5383af19f905309650fc1c1b75fcd43608cea4842c6c08d0715a24f05a37ea707a1013e72242
@@ -276,9 +276,12 @@ class window.PinkmanCollection extends window.PinkmanCommon
276
276
 
277
277
  # Desc: returns a new object associated with this collection
278
278
  new: (attributes) ->
279
- object = new (@config.memberClass)
280
- object.initialize(attributes)
281
- object
279
+ if @_new? and not @_new.id?
280
+ @_new
281
+ else
282
+ @_new = new (@config.memberClass)
283
+ @_new.initialize(attributes)
284
+ @_new
282
285
 
283
286
  # Desc: reload every object in this collection
284
287
  reload: (callback='') ->
@@ -31,7 +31,7 @@ module Pinkman
31
31
  end
32
32
 
33
33
  def can_write? attribute
34
- (write.include?(:all) or write.include?(attribute.to_sym)) and serializer.model.column_names.include?(attribute.to_s)
34
+ (write.include?(:all) or write.include?(attribute.to_sym)) and (serializer.model.column_names.include?(attribute.to_s) or serializer.model.instance_methods.include?("#{attribute.to_s}=".to_sym))
35
35
  end
36
36
 
37
37
  def can_access? action
@@ -1,3 +1,3 @@
1
1
  module Pinkman
2
- VERSION = "0.9.1.21"
2
+ VERSION = "0.9.1.23"
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: 0.9.1.21
4
+ version: 0.9.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agilso Oliveira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-18 00:00:00.000000000 Z
11
+ date: 2017-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler