-
Notifications
You must be signed in to change notification settings - Fork 3
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
tpi/not active companies #216
Merged
Merged
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
49ac626
add is active field to company
3fabd33
Merge branch 'develop' into feature/tpi-not-active-companies
4afcde9
code review
8f92edd
rename company's field
6aa061d
fix schema.rb
tsubik 8dedd6a
Merge branch 'develop' into feature/tpi-not-active-companies
59fd050
add active row to csv importer and only active companies in the chart…
861d064
remove extra changes
56dd0bc
bug fix
6c4a465
Merge branch 'develop' into feature/tpi-not-active-companies
04e5abd
remove extra changes
ad05108
update brakeman.ignore
dbc4dc6
show only active companies on the pie chart
2007332
code refactor
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module TPI | ||
class CompanyDecorator < Draper::Decorator | ||
delegate_all | ||
|
||
def name | ||
return model.name if model.active | ||
|
||
"#{model.name} (Not active)" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddActiveToCompany < ActiveRecord::Migration[6.0] | ||
def change | ||
add_column :companies, :active, :boolean, default: true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,7 @@ | |
t.string "sedol" | ||
t.text "latest_information" | ||
t.text "historical_comments" | ||
t.boolean "active", default: true | ||
t.index ["discarded_at"], name: "index_companies_on_discarded_at" | ||
t.index ["geography_id"], name: "index_companies_on_geography_id" | ||
t.index ["headquarters_geography_id"], name: "index_companies_on_headquarters_geography_id" | ||
|
@@ -115,6 +116,7 @@ | |
t.datetime "created_at", precision: 6, null: false | ||
t.datetime "updated_at", precision: 6, null: false | ||
t.string "content_type" | ||
t.string "youtube_link" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. some remnants from other branch ;) |
||
t.index ["page_id"], name: "index_contents_on_page_id" | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Just curious - are we sure that scopes
published
andactive
are independent of each other? Or maybe inactive companies should be always unpublished?If those are unrelated we could at least add another scope
published_active
as it looks those 2 go together at least in this controller.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.
Active flag is different from the publishable status. So you can have
published
&&inactive
companies, and they should still show up on the frontend, just not on all the charts, because an inactive company is a company that is not getting new assessments, but has historical ones. But we could add an extra scope for when we want both published and active if that makes it more clear.