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

Add icon url to currency (closes #1449) #1465

Merged
merged 2 commits into from
Aug 9, 2018
Merged

Add icon url to currency (closes #1449) #1465

merged 2 commits into from
Aug 9, 2018

Conversation

shal
Copy link

@shal shal commented Jul 20, 2018

No description provided.

@shal shal changed the title Add ability to use custom currency url Add ability to use custom currency icon url Jul 20, 2018
@shal shal changed the title Add ability to use custom currency icon url Add icon url to currency (closes #1449) Jul 20, 2018
@@ -202,6 +202,7 @@ def disabled?
# precision :integer default(8), not null
# created_at :datetime not null
# updated_at :datetime not null
# icon_url :string(255)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Place icon_url after precision
Add default value
Add validation url: { allow_blank: true }

private

def coin_icon_url(currency)
currency.icon_url || "yarn_components/cryptocurrency-icons/svg/color/#{currency.code}.svg"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think more safe will be to use

if currency.icon_url.blank?

@mod mod merged commit c0bdb86 into openware:master Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

4 participants