Created
August 5, 2019 13:21
-
-
Save ysv/6551483edf1fde9b1e2ed0558858bc3b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CURRENCY_PARAMS = { | |
name: { desc: -> { API::V2::Admin::Entities::Currency.documentation[:name][:desc] } }, | |
deposit_fee: { | |
type: { value: BigDecimal, message: 'admin.currency.non_decimal_deposit_fee' }, | |
values: { value: -> (p){ p >= 0 }, message: 'admin.currency.invalid_deposit_fee' }, | |
desc: -> { API::V2::Admin::Entities::Currency.documentation[:deposit_fee][:desc] }, | |
default: 0.0 | |
} | |
#... | |
} | |
params :create_currency_params do | |
CURRENCY_PARAMS.each do | |
# Use values from CURRENCY_PARAMS with default values | |
end | |
end | |
params :update_currency_params do | |
CURRENCY_PARAMS.each do | |
# Use values from CURRENCY_PARAMS without default values | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment