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
Feature/enable multiple isins #31
Conversation
company = Company.find_or_initialize_by(isin: row[:isin]) | ||
company = Company.find_or_initialize_by(name: row[:company_name]) | ||
|
||
company.isin = if company.isin.present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couldn't this be moved to company_attributes
method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably so. I kept it here, but it doesn't make so much sense now. I'll move it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, actually, I would need to pass the current isin to that method if I were to manage this there. Currently the company_attributes
is not aware of the record being updated. So not sure if that's worth it.
app/models/company.rb
Outdated
@@ -48,4 +48,8 @@ def latest_assessment | |||
def to_s | |||
name | |||
end | |||
|
|||
def isin_string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this belongs to CompanyDecorator
which needs to be created :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, this name is a bit confusing - this returns an array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right! I've moved the method to a new decorator, and I've renamed it to isin_as_tags
. 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
a611ff3
to
e308deb
Compare
This small PR allows the input of multiple isin codes for the same company.