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

default_country_code based on relation #174

Closed
kimyu92 opened this issue Jan 2, 2018 · 2 comments
Closed

default_country_code based on relation #174

kimyu92 opened this issue Jan 2, 2018 · 2 comments

Comments

@kimyu92
Copy link
Contributor

kimyu92 commented Jan 2, 2018

Is it possible to support relation-based default_country_code

phony_normalize :phone, default_country_code: -> { model.country_code }, add_plus: false
@sergioisidoro
Copy link

sergioisidoro commented Aug 28, 2018

Yeah, I struggled with the same issue. I was expecting this to work:

phony_normalize :phone, default_country_code: Proc.new { |instance| instance.country } 

@joost
Copy link
Owner

joost commented Aug 29, 2018

Pull requests always welcome.

kimyu92 pushed a commit to kimyu92/phony_rails that referenced this issue Sep 2, 2018
kimyu92 pushed a commit to kimyu92/phony_rails that referenced this issue Sep 2, 2018
kimyu92 pushed a commit to kimyu92/phony_rails that referenced this issue Sep 2, 2018
@joost joost closed this as completed in 2c94d17 Sep 5, 2018
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

3 participants