Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two attributes with the same alias #23

Closed
manuelmeurer opened this issue Sep 19, 2013 · 0 comments
Closed

Two attributes with the same alias #23

manuelmeurer opened this issue Sep 19, 2013 · 0 comments
Assignees

Comments

@manuelmeurer
Copy link
Contributor

I have the following response format:

{
  price: {
    amount: 179,
    currency: "EUR"
  }
}

I would like to have the attributes amount and currency, so I tried this

attribute :price, aliases: 'price', squash: 'amount'
attribute :currency, aliases: 'price', squash: 'currency'

Problem is that the alias of the second attribute overwrites the first attribute and the resulting object only has currency but no price.

@ghost ghost assigned lanej Sep 21, 2013
@lanej lanej closed this as completed in 7d1ba88 Sep 25, 2013
lanej added a commit that referenced this issue Sep 25, 2013
…tiple_attributes

Allow same aliases for multiple attributes, fixes #23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants