app/models/withdraw_limit.rb
# Get withdrawal limit for specific withdraw that based on member kyc_level and group.
# WithdrawLimit record selected with the next priorities:
#  1. kyc_level, group match
#  2. kyc_level match
#  3. group match
#  5. kyc_level, group are 'any'
#  6. default (zero limits)
Get withdrawal limit for specific withdraw that based on member kyc_level and group.
WithdrawLimit record selected with the next priorities:
1. kyc_level, group match
2.
Get withdrawal limit for specific withdraw that based on member kyc_level and group . WithdrawLimit record selected with the next priorities : 1 . kyc_level group match 2 .
def for(kyc_level:, group:)
      WithdrawLimit
        .where(kyc_level: [kyc_level, ANY], group: [group, ANY])
        .max_by(&:weight) || WithdrawLimit.new
    end
def for ( kyc_level : , group : ) WithdrawLimit . where ( kyc_level : [ kyc_level , ANY ] , group : [ group , ANY ] ) . max_by ( & :weight ) || WithdrawLimit . new end
Get withdrawal limit for specific withdraw that based on member kyc_level and group.
Get withdrawal limit for specific withdraw that based on member kyc_level and group .
kyc_level
group