wire-framework 0.1.4.4 → 0.1.4.6
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/app/db.rb +19 -0
- data/lib/app/render/document.rb +2 -0
- data/lib/app/render/page.rb +2 -0
- data/lib/app/render/partial.rb +2 -0
- data/lib/app/render/style.rb +1 -1
- data/lib/wire.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: e9091b240b3510eedfe46c4aa07967bd4f756455
|
4
|
+
data.tar.gz: 436065f65d2324671a6c6db94dd1dcb811f9b7be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d53663930e1d6b2fc17b8125323e808f0b1e31b9770c488bb79a31c353235abd1969c1c80b55bc076f4984ac0e498f5fd4595777132f57b829f40fac9c22a852
|
7
|
+
data.tar.gz: 3f15f6eb4a4a9bd9551e2ee96f4546cf99272ed1ba9214d6640c3e261e287bc680a57035a3482c954f04a5e10cfad4caa97547155996ba853f7e1ad27159accb
|
data/lib/app/db.rb
CHANGED
@@ -150,6 +150,23 @@ module DB
|
|
150
150
|
end
|
151
151
|
end
|
152
152
|
|
153
|
+
# Remove a specific object from the DB table
|
154
|
+
# @param [Hash] context the context for this request
|
155
|
+
# @return [Response] an object, or status code
|
156
|
+
def self.do_delete(context)
|
157
|
+
return 404 unless context.resource
|
158
|
+
model = context.resource[:model]
|
159
|
+
id = context.uri[3]
|
160
|
+
if model
|
161
|
+
instance = model.get(id)
|
162
|
+
if instance
|
163
|
+
instance.destroy
|
164
|
+
end
|
165
|
+
else
|
166
|
+
404
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
153
170
|
# Proxy method used when routing
|
154
171
|
# @param [Array] actions the allowed actions for this URI
|
155
172
|
# @param [Hash] context the context for this request
|
@@ -166,6 +183,8 @@ module DB
|
|
166
183
|
end
|
167
184
|
when :update
|
168
185
|
do_update(context)
|
186
|
+
when :delete
|
187
|
+
do_delete(context)
|
169
188
|
else
|
170
189
|
403
|
171
190
|
end
|
data/lib/app/render/document.rb
CHANGED
data/lib/app/render/page.rb
CHANGED
data/lib/app/render/partial.rb
CHANGED
data/lib/app/render/style.rb
CHANGED
data/lib/wire.rb
CHANGED