ns_service_pack 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,10 +1,12 @@
1
1
  #== TODO
2
2
 
3
3
  #==============History:
4
+ #==0.1.8
5
+ Fix FieldMapping#arrayify_conds的status字段加入条件
6
+
4
7
  #==0.1.7
5
8
  Fix and release 0.1.7
6
9
 
7
-
8
10
  #==0.1.6
9
11
  * Fix README 文件中的忘加Ns::的bug
10
12
  * 增大page_size的每页限制,原来250改为5000
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.7
1
+ 0.1.8
@@ -138,9 +138,16 @@ module Ns
138
138
  "#{db_key} = :#{buz_key}"
139
139
  end.join(" and ")
140
140
  end
141
- unless erp_admin?(params) && mapping.keys.include?(:status)
142
- cond_str << " and " unless cond_str.blank?
143
- cond_str << " #{mapping[:status]} != -1" #TODO FIXME -1 use
141
+ #如有status字段
142
+ if mapping.keys.include?(:status)
143
+ Rails.logger.debug "=======include status"
144
+ #如非erp admin后台请求
145
+ unless erp_admin?(params)
146
+ cond_str << " and " unless cond_str.blank?
147
+ cond_str << " #{mapping[:status]} != -1" #TODO FIXME -1 use
148
+ end
149
+ else
150
+ Rails.logger.debug "=======not include status"
144
151
  end
145
152
 
146
153
  result_array << cond_str
@@ -29,7 +29,9 @@ module Ns
29
29
 
30
30
  def self.service_url(service_key = '', params = {}, force_sub = true)
31
31
  #fixed a bug here, using dup to avoid modify the original templages
32
- the_url = services[service_key.to_sym].to_s.dup rescue ''
32
+ url_key = service_key.to_sym
33
+ raise "Not found key:#{url_key} in the config file:#{SERVICE_CONFIG_FILE}" unless @@services.key?(url_key)
34
+ the_url = services[url_key].to_s.dup rescue ''
33
35
  if force_sub && params[:id]
34
36
  the_url.sub!(':id', params[:id].to_s)
35
37
  end
@@ -1,5 +1,5 @@
1
1
  #coding: utf-8
2
2
  module NsServicePack
3
3
  puts "Warnign: TODO USE JEWELER DEFAULT VERSION MECHANISM NOW!"
4
- VERSION = '0.0.16'
4
+ VERSION = '0.1.7'
5
5
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "ns_service_pack"
8
- s.version = "0.1.7"
8
+ s.version = "0.1.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Caory, Shang, Geogeous"]
12
- s.date = "2011-12-17"
12
+ s.date = "2011-12-20"
13
13
  s.description = "abstract some common pattern to service pack"
14
14
  s.email = "cao7113@hotmail.com"
15
15
  s.executables = ["nsp"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ns_service_pack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-17 00:00:00.000000000Z
12
+ date: 2011-12-20 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: &82356530 !ruby/object:Gem::Requirement
16
+ requirement: &77441410 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.6.7
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *82356530
24
+ version_requirements: *77441410
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: thor
27
- requirement: &82356120 !ruby/object:Gem::Requirement
27
+ requirement: &77441150 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.14.6
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *82356120
35
+ version_requirements: *77441150
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: shoulda
38
- requirement: &82355630 !ruby/object:Gem::Requirement
38
+ requirement: &77440900 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *82355630
46
+ version_requirements: *77440900
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
- requirement: &82355350 !ruby/object:Gem::Requirement
49
+ requirement: &77440610 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.0.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *82355350
57
+ version_requirements: *77440610
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: jeweler
60
- requirement: &82354930 !ruby/object:Gem::Requirement
60
+ requirement: &77440340 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.6.4
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *82354930
68
+ version_requirements: *77440340
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rcov
71
- requirement: &82354540 !ruby/object:Gem::Requirement
71
+ requirement: &77440080 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *82354540
79
+ version_requirements: *77440080
80
80
  description: abstract some common pattern to service pack
81
81
  email: cao7113@hotmail.com
82
82
  executables:
@@ -141,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
141
141
  version: '0'
142
142
  segments:
143
143
  - 0
144
- hash: 896815169
144
+ hash: 78328239
145
145
  required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  none: false
147
147
  requirements: