File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
actiontext/lib/action_text Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ class TrixAttachment
9
9
ATTRIBUTES = %w( sgid contentType url href filename filesize width height previewable content ) + COMPOSED_ATTRIBUTES
10
10
ATTRIBUTE_TYPES = {
11
11
"previewable" => -> ( value ) { value . to_s == "true" } ,
12
- "filesize" => -> ( value ) { Integer ( value . to_s ) rescue value } ,
13
- "width" => -> ( value ) { Integer ( value . to_s ) rescue nil } ,
14
- "height" => -> ( value ) { Integer ( value . to_s ) rescue nil } ,
12
+ "filesize" => -> ( value ) { Integer ( value . to_s , exception : false ) || value } ,
13
+ "width" => -> ( value ) { Integer ( value . to_s , exception : false ) } ,
14
+ "height" => -> ( value ) { Integer ( value . to_s , exception : false ) } ,
15
15
:default => -> ( value ) { value . to_s }
16
16
}
17
17
You can’t perform that action at this time.
0 commit comments