Skip to content

Instantly share code, notes, and snippets.

@luckyruby
Created April 20, 2012 22:04
Show Gist options
  • Save luckyruby/2432201 to your computer and use it in GitHub Desktop.
Save luckyruby/2432201 to your computer and use it in GitHub Desktop.
response[:fees] = reservation.reservation_fees.map do |fee|
fee.attributes.select { |k,v| %w(name rate quantity amount).include? k }.symbolize_keys
end
response[:fees] = reservation.reservation_fees.map do |fee|
{
:name => fee.name,
:rate => fee.rate,
:quantity => fee.quantity,
:amount => fee.amount
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment