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 CHANGED
@@ -7,7 +7,7 @@ require 'rake/testtask'
7
7
 
8
8
  spec = Gem::Specification.new do |s|
9
9
  s.name = 'six-updater-web'
10
- s.version = '0.23.4'
10
+ s.version = '0.23.5'
11
11
  s.has_rdoc = false
12
12
  #s.extra_rdoc_files = ['README', 'LICENSE']
13
13
  s.summary = 'Your summary here'
@@ -2,6 +2,8 @@ class Appsetting < ActiveRecord::Base
2
2
  has_many :sixconfigs
3
3
  six_guid
4
4
 
5
+ OVERRIDE_MODEL = Appsetting
6
+
5
7
  FOLDER = /(.*)\/(.*)/
6
8
 
7
9
  # Defaults to ArmA2 atm...
@@ -12,6 +12,7 @@ class Mod < ActiveRecord::Base
12
12
 
13
13
  six_guid
14
14
 
15
+ OVERRIDE_MODEL = Mod
15
16
 
16
17
  def all_dependentmods(mods = [])
17
18
  mods += [self]
@@ -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
- if l.size > 0
81
- content = "Synchronized #{l.size} records with server-site!" #l.map {|e| e.to_json}.join(", ")
82
- else
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
@@ -22,7 +22,7 @@ case RUBY_VERSION
22
22
  end
23
23
 
24
24
  module SixUpdaterWeb
25
- VERSION = "0.23.4"
25
+ VERSION = "0.23.5"
26
26
  COMPONENT = "six-updater-web"
27
27
 
28
28
  DEFAULT_IP = "127.0.0.1" unless defined?(DEFAULT_IP)
@@ -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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 23
8
- - 4
9
- version: 0.23.4
8
+ - 5
9
+ version: 0.23.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sickboy