haraway 0.1.0.dev.48 → 0.1.0.dev.50

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: cb60ec484eb10fe2076801520baa6163341f543c
4
- data.tar.gz: e9cbf19c70e7f1a9f4d135cfb75175835b67a48e
3
+ metadata.gz: 0ba9179cdab2390040d9917b2075bf672916b7f5
4
+ data.tar.gz: 5bebe1c3091291de9a173ff31479a7582ce6119f
5
5
  SHA512:
6
- metadata.gz: 3deb0480ab6495742a4da222f66de30fc635f3c940c69c98f98bb788c9f8b12e5376f197723916ef8b33a217d8da63308a7226b60d02f3633b4cfb9042eb8d71
7
- data.tar.gz: 98da395867e5fa3bb025b883320008950f02f76f7a7e98f550a7a40259fbbb3de21f42cf0940d073d168e5acca0d73402e27b3b49d9016c7be899adffbf67a6e
6
+ metadata.gz: d2e8f4dfc088838c5b06dd19f719e915dccd1a3e20a2a0989a40c35bb3bfc099d5a7a95b255bc89809e46d5626c6bb407bd698e86ed1043ed60beb27824f8654
7
+ data.tar.gz: ddb81fd73cf922ef96e2231bca8cc7b4bbb110fecda089af1698298e432486ebb5c18dd9effe7ace24ff25d9afbfcb5f0c95cbcedf7abf2dbd019591fb4e6930
@@ -29,7 +29,7 @@ class Haraway::ActiveRecord::Asset
29
29
  end
30
30
 
31
31
  def update_attributes(attributes)
32
- @_destroy = (attributes[:_destroy] == "t" || attributes[:_destroy] == "1" || attributes[:_destroy] == 1)
32
+ @_destroy = (attributes[:_destroy] == "t" || attributes[:_destroy] == "1" || attributes[:_destroy] == 1 || attributes[:_destroy] == true)
33
33
  @attributes = attributes.except(:id, :_destroy)
34
34
  end
35
35
 
@@ -10,8 +10,8 @@ private
10
10
  new_assets = []
11
11
 
12
12
  attributes.each do |attrs|
13
- asset_id = attrs[:id]
14
- asset = old_assets.delete(asset_id)
13
+ asset_id = attrs[:id]
14
+ asset = old_assets.delete(asset_id)
15
15
 
16
16
  if asset_id.blank? or asset_id == "undefined"
17
17
  next
@@ -74,6 +74,8 @@ private
74
74
 
75
75
  haraway_assets[name] = defn
76
76
 
77
+ attr_accessible name
78
+
77
79
  include Haraway::ActiveRecord::Macro::MetaData
78
80
 
79
81
  include Module.new.class_eval <<-RUBY, __FILE__, __LINE__+1
@@ -98,6 +100,8 @@ private
98
100
 
99
101
  haraway_assets[name] = defn
100
102
 
103
+ attr_accessible name
104
+
101
105
  include Haraway::ActiveRecord::Macro::MetaData
102
106
 
103
107
  include Module.new.class_eval <<-RUBY, __FILE__, __LINE__+1
@@ -107,13 +111,7 @@ private
107
111
  end
108
112
 
109
113
  def #{name}=(value)
110
- values = [value]
111
-
112
- haraway_read_assets(#{name.inspect}).each do |old_asset|
113
- old_asset.destroy!
114
- values.push(old_asset.attributes)
115
- end
116
-
114
+ values = [value].compact
117
115
  haraway_write_assets(#{name.inspect}, values)
118
116
  end
119
117
 
@@ -167,10 +165,12 @@ private
167
165
  Haraway::Committer.new(Haraway.configuration, asset_ids).commit!
168
166
  @_haraway_uploaded_assets = nil
169
167
  end
168
+
169
+ nil
170
170
  end
171
171
 
172
172
  def delete_haraway_assets
173
- return self.haraway_deleted_assets.blank?
173
+ return if self.haraway_deleted_assets.blank?
174
174
 
175
175
  asset_ids = []
176
176
 
@@ -182,6 +182,8 @@ private
182
182
  Haraway::Deleter.new(Haraway.configuration, asset_ids).delete!
183
183
  @_haraway_deleted_assets = nil
184
184
  end
185
+
186
+ nil
185
187
  end
186
188
 
187
189
  end
@@ -1,6 +1,6 @@
1
1
  module Haraway
2
2
  VERSION = "0.1.0"
3
- BUILD = "48"
3
+ BUILD = "50"
4
4
 
5
5
  if BUILD != ("{{BUILD_NUMBER" + "}}") # prevent sed replacement (see script/ci)
6
6
  BUILD_VERSION = "#{VERSION}.dev.#{BUILD}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haraway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.dev.48
4
+ version: 0.1.0.dev.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Menke