six-updater-web 0.23.4 → 0.23.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/six-updater-web/app/models/appsetting.rb +2 -0
- data/lib/six-updater-web/app/models/mod.rb +1 -0
- data/lib/six-updater-web/app/models/system_setting.rb +5 -10
- data/lib/six-updater-web/config/six-updater-web.rb +1 -1
- data/lib/six-updater-web/vendor/plugins/six-import/lib/six/import.rb +10 -3
- metadata +2 -2
data/Rakefile
CHANGED
@@ -73,17 +73,12 @@ class SystemSetting < ActiveRecord::Base
|
|
73
73
|
def sync
|
74
74
|
self.synchronized_at = Time.now
|
75
75
|
self.save
|
76
|
-
Mod.delete_all("type IS NULL or name IS NULL")
|
77
|
-
Appsetting.delete_all("type IS NULL or name IS NULL")
|
78
|
-
content = nil
|
76
|
+
#Mod.delete_all("type IS NULL or name IS NULL")
|
77
|
+
#Appsetting.delete_all("type IS NULL or name IS NULL")
|
79
78
|
l = self.synchronize
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
content = "WARNING: No objects received, possibly issue with connection (timeout?), or server site"
|
84
|
-
end
|
85
|
-
Mod.delete_all("type IS NULL or name IS NULL")
|
86
|
-
Appsetting.delete_all("type IS NULL or name IS NULL")
|
79
|
+
content = l.size > 0 ? "Synchronized #{l.size} records with server-site!" : "WARNING: No objects received, possibly issue with connection (timeout?), or server site"
|
80
|
+
#Mod.delete_all("type IS NULL or name IS NULL")
|
81
|
+
#Appsetting.delete_all("type IS NULL or name IS NULL")
|
87
82
|
content
|
88
83
|
end
|
89
84
|
end
|
@@ -55,10 +55,17 @@ module Six
|
|
55
55
|
end
|
56
56
|
|
57
57
|
module ClassMethods
|
58
|
+
|
59
|
+
def override_class
|
60
|
+
defined?(self::OVERRIDE_MODEL) ? self::OVERRIDE_MODEL : self
|
61
|
+
end
|
62
|
+
|
58
63
|
def blabla(h)
|
59
64
|
l = []
|
60
65
|
h.each_pair do |key, value|
|
61
66
|
l << self.from_hash(value.merge({:type => key.camelize.singularize}))
|
67
|
+
# Officially??
|
68
|
+
# l << Object.const_get(key.camelize.singularize).from_hash(value.merge({:type => key.camelize.singularize}))
|
62
69
|
end
|
63
70
|
l
|
64
71
|
end
|
@@ -80,10 +87,10 @@ module Six
|
|
80
87
|
case h
|
81
88
|
when Array
|
82
89
|
h.each do |b|
|
83
|
-
k += blabla(b)
|
90
|
+
k += self.blabla(b)
|
84
91
|
end
|
85
92
|
when Hash
|
86
|
-
k += blabla h
|
93
|
+
k += self.blabla h
|
87
94
|
end
|
88
95
|
k
|
89
96
|
end
|
@@ -106,7 +113,7 @@ module Six
|
|
106
113
|
h.delete "id"
|
107
114
|
r = nil
|
108
115
|
begin
|
109
|
-
r = self.find(id)
|
116
|
+
r = self.override_class.find(id)
|
110
117
|
rescue
|
111
118
|
end
|
112
119
|
if r
|