Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rails_param
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
ikcrm_common
rails_param
Commits
0d514aaa
Commit
0d514aaa
authored
May 09, 2016
by
李福中
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统一异常错误消息为`field`格式不正确
parent
d0a3119d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
15 deletions
+1
-15
lib/rails_param/param.rb
+1
-15
No files found.
lib/rails_param/param.rb
View file @
0d514aaa
...
@@ -95,7 +95,7 @@ module RailsParam
...
@@ -95,7 +95,7 @@ module RailsParam
end
end
return
nil
return
nil
rescue
ArgumentError
rescue
ArgumentError
raise
InvalidParameterError
,
error_message_for
(
nil
,
"
#{
options
[
:label
]
||
param
}
不是合法的
#{
data_type_i18n
(
type
)
}
"
,
options
)
raise
InvalidParameterError
,
error_message_for
(
nil
,
"
#{
options
[
:label
]
||
param
}
格式不正确
"
,
options
)
end
end
end
end
...
@@ -145,19 +145,5 @@ module RailsParam
...
@@ -145,19 +145,5 @@ module RailsParam
end
end
end
end
def
data_type_i18n
(
type
)
{
Integer
=>
'整数'
,
Float
=>
'数字'
,
String
=>
'字符串'
,
Date
=>
'日期'
,
Time
=>
'时间'
,
DateTime
=>
'日期时间'
,
Array
=>
'数组'
,
Hash
=>
'哈希'
,
BigDecimal
=>
'数字'
}
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment