polyblock 0.3.9 → 0.4.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5167a870413707136181d0211eeb379d516afdb2
|
4
|
+
data.tar.gz: 023d6566dddfbd6e236dce083d39175e206daadd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ce4d7bdaaab32a4cb42decd7bef403fddc9943055bb822e8acb48474ba3f4f6f873689cea01c12a599705f68c8863a33655b1866bcce0f9e28df016b719ba16
|
7
|
+
data.tar.gz: 8dc0af791b25478ab1f2fc24bdbce31fb0abbe0ccd876e7971c7a83981ba0a0bd3f43e0308094ca83451dc3106c16d09e3276d5984086f9a6b2456f76cdcb1cd
|
@@ -6,13 +6,13 @@ module Polyblock
|
|
6
6
|
def update
|
7
7
|
if params.has_key? :pbs and params[:pbs].any?
|
8
8
|
params[:pbs].each do |i, attrs|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
pb_find = Block.where(:id => attrs[:id])
|
10
|
+
attrs.delete(:id)
|
11
|
+
if pb_find.any? && pb_find.first.name == attrs[:name]
|
12
|
+
pb_find.first.update_attributes!(attrs)
|
13
|
+
else
|
14
|
+
Block.create! attrs
|
15
|
+
end
|
16
16
|
end
|
17
17
|
end
|
18
18
|
render :text => "OK!"
|
data/lib/polyblock/version.rb
CHANGED
Binary file
|