Skip to content

Instantly share code, notes, and snippets.

@luckyruby
Created April 3, 2012 18:13
Show Gist options
  • Save luckyruby/2294327 to your computer and use it in GitHub Desktop.
Save luckyruby/2294327 to your computer and use it in GitHub Desktop.
def self.get_fees(location_id)
{
flat: {
specific: LocationFee.where(location_id: location_id, pricing: 'flat', rate_category_specific: true, active: true),
unspecific: LocationFee.where(location_id: location_id, pricing: 'flat', rate_category_specific: false, active: true)
},
per_day: {
specific: LocationFee.where(location_id: location_id, pricing: 'per_day', rate_category_specific: true, active: true),
unspecific: LocationFee.where(location_id: location_id, pricing: 'per_day', rate_category_specific: true, active: true)
},
percent: {
specific: LocationFee.where(location_id: location_id, pricing: 'percent', rate_category_specific: true, active:true),
unspecific: LocationFee.where(location_id: location_id, pricing: 'percent', rate_category_specific: false, active:true)
}
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment