subapp_model 0.9.2 → 0.9.4

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: 7bae56be7585c1055baf65648cdf1506f6d5dddc
4
- data.tar.gz: 29fae4545529fac7e4fafcd53bbe3fb1891fa048
3
+ metadata.gz: 4799ed5473c494b5aa6960b840e96d6f8347306d
4
+ data.tar.gz: df2b2eb5e1568da58e322d3f64a6b400340431fc
5
5
  SHA512:
6
- metadata.gz: 1bdd68436712a7b731a8eefbb564c62ffc9320c5ca375d342ee0e159e30d5e4496154242579d88020f36254aff0ecba408ef47e16d835da3d59467ee5f0d54de
7
- data.tar.gz: 826a6a4d3ab3cd171cc45c07f2893f2647c7cbb9beb775c73264ca61931fd82193f08b5b55b41a7e9b80db7202e154a8e819a17f72772f5c3b5818f0e99d807e
6
+ metadata.gz: d14e99687dc0dad8d8668d6a2b35b286de234a653b504744cf76ebcb29dcc542facaf90a3963e0892dafd378383fa04fad041495f565c24b2f598cd579e495c4
7
+ data.tar.gz: 5df367acaf89e05ec0fc3947f359eb2c8df91958b1cbd28cb0b20e1545be5c5d0dc37730b6cf346508be47b252f9c3efde62b7fb154c38ad80c607a5b0d22ace
data/lib/subapp_model.rb CHANGED
@@ -8,18 +8,29 @@ rescue LoadError
8
8
  end
9
9
  # if not using Railtie, call `Kaminari::Hooks.init` directly
10
10
  if defined? Rails
11
- puts "load rails"
12
- Rails.configuration.autoload_paths = [File.expand_path("../#{dir}", __FILE__)]
11
+ if (!defined? RAILS_APP_MODULE) || RAILS_APP_MODULE.nil?
12
+ %w{subapp_model}.each do |dir|
13
+ puts __FILE__
14
+ Dir.glob(File.expand_path("../#{dir}", __FILE__) + '/**/*.rb').each do |file|
15
+ puts file
16
+ require file
17
+ end
18
+ end
19
+ else
20
+ current_file = __FILE__
21
+ load_str = "module " + RAILS_APP_MODULE + "; class Application < Rails::Application; config.autoload_paths += [File.expand_path(\"../subapp_model\", \"#{current_file}\")]; end; end"
22
+ eval(load_str)
23
+ end
13
24
  else
14
25
  %w{subapp_model}.each do |dir|
15
26
  Dir.glob(File.expand_path("../#{dir}", __FILE__) + '/**/*.rb').each do |file|
16
27
  # if(file.index("home_controller") == nil)
17
- $LOAD_PATH.unshift(file)
28
+ # $LOAD_PATH.unshift(file)
18
29
 
19
30
  require_file = File.basename(file, ".rb")
20
31
  require_class = require_file.split('_').map {|w| w.capitalize}.join
21
32
 
22
- #puts "#{require_class} : #{file}"
33
+ # puts "#{require_class} : #{file}"
23
34
 
24
35
  autoload "#{require_class}".to_sym,file
25
36
  end
@@ -11,7 +11,7 @@ class App < ActiveRecord::Base
11
11
  :app_icon_57_path,
12
12
  :app_icon_124_path,
13
13
  :background_path,
14
- :default_background,
14
+ :default_background,
15
15
  :loading_icon_path,
16
16
  :loading_default,
17
17
  :loading_320x480_path,
@@ -37,12 +37,17 @@ class App < ActiveRecord::Base
37
37
  :app_icon_144_path, #android用
38
38
  :channel_num, #渠道号
39
39
  :baidu_ios_id, :baidu_ios_key, :baidu_android_id, :baidu_android_key, :ios_ads, :android_ads, :ios_is_upgraded, :android_is_upgraded,
40
- :ios_is_recommended, :android_is_recommended
40
+ :ios_is_recommended, :android_is_recommended, :ad_id, :is_push, :ios_version, :android_version, :production_id, :skin, :font,
41
+ :is_lite, :ios_is_search, :android_is_search,
42
+ :qq_ios_key, :qq_android_key,
43
+ :qq_ios_id, :qq_android_id,
44
+ :app_icon_120_path, :app_type, :file_url, :certificate_url,
45
+ :ios_is_chaping, :android_is_chaping
41
46
 
42
47
  validates :title, :apple_appid, :name, :certificate_name, :presence => true
43
- CONTENT_TYPES = {MUTI_BOZHU: 1, SINGLE_PERSON: 2, SINGLE_ALBUM: 3}
48
+ CONTENT_TYPES = {MUTI_BOZHU: 1, SINGLE_PERSON: 2, SINGLE_ALBUM: 3, MUTI_CATEGORY: 4, SINGLE_CATEGORY: 5, ALL_CATEGORY: 6}
44
49
  # json:
45
- # {
50
+ # {
46
51
  # id: app.id,
47
52
  # title: app.title, # app名
48
53
  # name: app.name, # app名
@@ -76,6 +81,10 @@ class App < ActiveRecord::Base
76
81
  "单用户多专辑"
77
82
  when 3
78
83
  "单用户单专辑"
84
+ when 4
85
+ "多分类"
86
+ when 5
87
+ "单分类"
79
88
  end
80
89
  end
81
90
 
@@ -88,5 +97,4 @@ class App < ActiveRecord::Base
88
97
  end
89
98
  end
90
99
 
91
-
92
100
  end
@@ -2,5 +2,5 @@
2
2
  class AppAd < ActiveRecord::Base
3
3
  establish_connection SUBAPP_DB
4
4
  self.table_name = 'tb_app_ad' # 子App广告
5
- attr_accessible :name, :description
5
+ attr_accessible :name, :description, :is_delete
6
6
  end
@@ -2,5 +2,5 @@
2
2
  class AppCategory < ActiveRecord::Base
3
3
  establish_connection SUBAPP_DB
4
4
  self.table_name = 'tb_app_category' # 子App分类类型
5
- attr_accessible :appid, :category_id, :is_all_tags, :order_num
5
+ attr_accessible :app_id, :category_id, :category_version, :is_all_tags, :order_num
6
6
  end
@@ -1,6 +1,5 @@
1
- #-*- encoding: utf-8 -*-
2
1
  class AppMaterial < ActiveRecord::Base
3
2
  establish_connection SUBAPP_DB
4
3
  self.table_name = 'tb_app_material' # 子App物料
5
- attr_accessible :pic_url, :web_url, :is_delete, :name
4
+ attr_accessible :pic_url, :web_url, :name
6
5
  end
@@ -1,3 +1,3 @@
1
1
  module SubappModel
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subapp_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - gavin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-01 00:00:00.000000000 Z
11
+ date: 2013-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler