haraway 0.1.0.dev.48 → 0.1.0.dev.50
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 +4 -4
- data/lib/haraway/active_record/asset.rb +1 -1
- data/lib/haraway/active_record/macro.rb +12 -10
- data/lib/haraway/lib_version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ba9179cdab2390040d9917b2075bf672916b7f5
|
4
|
+
data.tar.gz: 5bebe1c3091291de9a173ff31479a7582ce6119f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
14
|
-
asset
|
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
|
data/lib/haraway/lib_version.rb
CHANGED