side_do 0.1.1 → 0.1.2
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/bin/game.rb +0 -32
- data/lib/side_do/version.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: 5942c1bf44bb6fc6449761c19db21cd15e838e47
|
|
4
|
+
data.tar.gz: b20eda195e20795ba868a8fb444072e410e3958a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f3a3c9559956f370fb7e2126df6e324b58c927ca77ebfeed1e4cf3d1db6872d784f0f7d4a4ec07a9bc1a06026cbb3a9e92c1a37bf4fe2380e4679ea88dc948e3
|
|
7
|
+
data.tar.gz: a484a5693fc016c3c94870630927d221658b4eb8622b9ac0972dbbe901b5dd60e84b1efe8b713ea1ba9c883e0bbdd16839ecac782c98b02557a8ecfefb58d2f1
|
data/bin/game.rb
CHANGED
|
@@ -18,47 +18,15 @@ class Game < ActiveRecord::Base
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
class Games::Base < Game
|
|
21
|
-
# Defalut values
|
|
22
|
-
default_value_for :install_type, 'green'
|
|
23
|
-
|
|
24
|
-
# Callbacks
|
|
25
|
-
before_save :update_bundle_price
|
|
26
|
-
|
|
27
|
-
def type_name
|
|
28
|
-
"普通游戏"
|
|
29
|
-
end
|
|
30
21
|
end
|
|
31
22
|
|
|
32
23
|
class Games::DLC < Game
|
|
33
|
-
# Callbacks
|
|
34
|
-
before_save :update_bundle_price
|
|
35
|
-
|
|
36
|
-
def type_name
|
|
37
|
-
"DLC"
|
|
38
|
-
end
|
|
39
24
|
end
|
|
40
25
|
|
|
41
26
|
class Games::LanguagePack < Game
|
|
42
|
-
def type_name
|
|
43
|
-
"语言包"
|
|
44
|
-
end
|
|
45
27
|
end
|
|
46
28
|
|
|
47
29
|
class Games::Bundle < Game
|
|
48
|
-
|
|
49
|
-
# Associations
|
|
50
|
-
# There is a bug of rails3 for [:inverse_of]: forbid add callbacks. It would be removed in rails4
|
|
51
|
-
has_many :bundle_games, :inverse_of => :bundle, :before_add => :forbid_callback, :before_remove => :forbid_callback
|
|
52
|
-
has_many :games, :through => :bundle_games
|
|
53
|
-
|
|
54
|
-
# Methods
|
|
55
|
-
def total_discount
|
|
56
|
-
self.bundle_games.inject(BigDecimal.new(0)) { |result, bg| result + bg.discount }
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
def type_name
|
|
60
|
-
"游戏包"
|
|
61
|
-
end
|
|
62
30
|
end
|
|
63
31
|
|
|
64
32
|
class GameFile < ActiveRecord::Base
|
data/lib/side_do/version.rb
CHANGED