simplemdm 1.1.2 → 1.1.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: 9cf1cb4994ed69aced823f1bc776e6a8669a4f75
4
- data.tar.gz: 3c180793805786316f12a5f929b3db4202f66e02
3
+ metadata.gz: 450a6e83352102b742d03a7ebb14ce5414e7cf1c
4
+ data.tar.gz: 06edd1f7ee71fea449ce78ab6c57cef65bc525c6
5
5
  SHA512:
6
- metadata.gz: a7b71c8e55d2ec04821afa933efecdbc18b211dbefe7c9e8cf395f92f991cd7a8d164c696b3f2088bb9e8023e5d53b8b4faecd10ac8027b114095dde4e028ffb
7
- data.tar.gz: e8349f56422f9525f013da9ad21149b8c30b3fbcdf0accb345dcb59003c479b10bea51dd9ecf9861a06cc5bdfd2fac2b6ac2eab0bbd4ce516495fdabc20c12df
6
+ metadata.gz: 77622d9c6fb8e71f498faed61cd33bfbf0d2e223980e11287a4eb749fee0b2a2bb27b6e71af8a72662146b7c4100867f53bcb0a0824aa00b56add35578e36f6b
7
+ data.tar.gz: 6fa0fa9a769cf91a9ff6885d0b272935429c73824e70421a5da9560bb27968416856389ecfbdaacb99493354202c0ae2f1270417a9eb2ea44efd8cac07cf1b5d
@@ -15,4 +15,9 @@
15
15
  - Gem properly declares 'Hashie' gem dependency now.
16
16
 
17
17
  ## [0.1.0] - 2015-10-20
18
- - Initial release
18
+ - Initial release
19
+
20
+ ## [1.1.3] - 2016-9-29
21
+ ### Fixed
22
+ - New App objects failed to save when 'binary' was declared as an initialization argument.
23
+ - App objects were not able to update their 'name' attribute.
@@ -1,9 +1,19 @@
1
1
  module SimpleMDM
2
2
  class App < Base
3
3
 
4
+ # overwrite base class
5
+ def initialize(source_hash = nil, default = nil, &blk)
6
+ if source_hash && source_hash.kind_of?(Hash) && binary = source_hash[:binary]
7
+ self.binary = binary
8
+ source_hash.delete(:binary)
9
+ end
10
+
11
+ super(source_hash, detault, &blk)
12
+ end
13
+
4
14
  def build(hash = nil)
5
15
  @dirty = false
6
- @binary_data = nil
16
+ @binary_file = nil
7
17
 
8
18
  super
9
19
  end
@@ -27,9 +37,21 @@ module SimpleMDM
27
37
  @binary_file = val
28
38
  end
29
39
 
40
+ def name=(val)
41
+ if val != self.name
42
+ @dirty = true
43
+ end
44
+
45
+ self['name'] = val
46
+ end
47
+
30
48
  def save
31
- if (@dirty || new?) && @binary_file
32
- params = { binary: @binary_file }
49
+ raise "binary must be set before saving" if new? && @binary_file.nil?
50
+
51
+ if @dirty || new?
52
+ params = {}
53
+ params[:name] = self.name unless self.name.nil?
54
+ params[:binary] = @binary_file if @binary_file
33
55
 
34
56
  if new?
35
57
  hash, code = fetch("apps", :post, params)
@@ -1,3 +1,3 @@
1
1
  module SimpleMDM
2
- VERSION = "1.1.2".freeze
2
+ VERSION = "1.1.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplemdm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Boyko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-03 00:00:00.000000000 Z
11
+ date: 2016-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler