six-updater-web 0.18.0 → 0.18.1

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.18.0'
10
+ s.version = '0.18.1'
11
11
  s.has_rdoc = false
12
12
  #s.extra_rdoc_files = ['README', 'LICENSE']
13
13
  s.summary = 'Your summary here'
@@ -15,9 +15,4 @@ class ActionsController < ApplicationController
15
15
  config.action_links.add 'copy', :label => 'Clone', :type => :record, :position => false, :confirm => "Do you really want to *clone* this item?"
16
16
  end
17
17
 
18
- def copy
19
- t = copy_ll(Action)
20
- @original_record = t[0]
21
- @record = t[1]
22
- end
23
18
  end
@@ -32,9 +32,4 @@ class AppsettingsController < ApplicationController
32
32
  @processes = []
33
33
  end
34
34
  end
35
- def copy
36
- t = copy_ll(Appsetting)
37
- @original_record = t[0]
38
- @record = t[1]
39
- end
40
35
  end
@@ -8,7 +8,7 @@ class QueryserversController < ApplicationController
8
8
  config.columns = [:name, :ip, :port, :numplayers, :ping, :country, :gametype, :mission, :mapname, :mods, :saved_password, :updated_at,
9
9
  :password, :sv_battleye, :verifysignatures, :dedicated, :favorite, :difficulty, :gamestate, :gamemode,
10
10
  :language, :gamever, :platform, :exec2, :mod, :signatures, :players]
11
- config.list.columns.exclude :saved_password, :ip, :port, :gamestate, :language, :difficulty, :gamever, :gamemode, :mapname, :platform,
11
+ config.list.columns.exclude :saved_password, :ip, :port, :gamestate, :language, :difficulty, :gamemode, :mapname, :platform,
12
12
  :sv_battleye, :players, :signatures, :mod
13
13
  config.show.columns.exclude :mission # :players # Encoding problem when both are displayed, with russian text?
14
14
  config.update.columns.exclude :exec2
@@ -30,4 +30,10 @@ class SixconfigsController < ApplicationController
30
30
  config.columns[column].inplace_edit = true
31
31
  end
32
32
  end
33
+
34
+ def copy
35
+ t = copy_ll(Kernel.const_get(self.controller_name.singularize.camelize), [:mods])
36
+ @original_record = t[0]
37
+ @record = t[1]
38
+ end
33
39
  end
@@ -15,6 +15,10 @@ class Queryserver < ActiveRecord::Base
15
15
  [self.ip, self.port].join(":")
16
16
  end
17
17
 
18
+ def to_label
19
+ "#{self.name} (v#{self.gamever})"
20
+ end
21
+
18
22
  def mods_fetch
19
23
  if self.mod.size > 0
20
24
  self.mod.reject {|m| SYS_MODS.include? m }.map do |m|
@@ -22,7 +22,7 @@ case RUBY_VERSION
22
22
  end
23
23
 
24
24
  module SixUpdaterWeb
25
- VERSION = "0.18.0"
25
+ VERSION = "0.18.1"
26
26
  COMPONENT = "six-updater-web"
27
27
 
28
28
  DEFAULT_IP = "127.0.0.1" unless defined?(DEFAULT_IP)
@@ -9,12 +9,6 @@ module Six
9
9
 
10
10
  module ClassMethods
11
11
  public
12
- def copy
13
- t = copy_ll(Kernel.const_get(self.controller_name.singularize.camelize))
14
- @original_record = t[0]
15
- @record = t[1]
16
- end
17
-
18
12
  def six_local_auto_login
19
13
  if request.remote_ip == "127.0.0.1" && defined?(SixUpdaterWeb::SIX_ADMIN)
20
14
  if SixUpdaterWeb::SIX_ADMIN
@@ -25,6 +19,12 @@ module Six
25
19
  end
26
20
  end
27
21
 
22
+ def copy
23
+ t = copy_ll(Kernel.const_get(self.controller_name.singularize.camelize))
24
+ @original_record = t[0]
25
+ @record = t[1]
26
+ end
27
+
28
28
  private
29
29
  def copy_ll(cl, include = [])
30
30
  record = cl.find(params[:id])
@@ -35,6 +35,14 @@ module Six
35
35
  end
36
36
  #new_record.id = nil
37
37
  new_record.updated_at = nil
38
+ # TODO: only each if plural... or class == AR Association
39
+ include.each do |i|
40
+ n = new_record.send i
41
+ o = record.send i
42
+ o.each do |m|
43
+ n << m
44
+ end
45
+ end
38
46
  new_record.save
39
47
  [record, new_record]
40
48
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 18
8
- - 0
9
- version: 0.18.0
8
+ - 1
9
+ version: 0.18.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sickboy