-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes and changes for the data dashboard backend (#2159)
Some fixes and changes for the data dashboard backend: - CV2-5812: Expand the "matched media" data point to include all tipline request types. - CV2-5813: Use the default language when an explainer is created without language (includes migration rake task). - CV2-5842: Use updated_at instead of created_at for article tags analytics. - CV2-5835: For messages analytics, include only the states sent and received. - CV2-5836: Use the top_media_tags method from CheckDataPoints lib in the TeamStatistics lib.
- Loading branch information
Showing
6 changed files
with
43 additions
and
10 deletions.
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
18 changes: 18 additions & 0 deletions
18
lib/tasks/migrate/20241216215050_set_language_for_explainers.rake
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,18 @@ | ||
namespace :check do | ||
namespace :migrate do | ||
task set_language_for_explainers: :environment do | ||
started = Time.now.to_i | ||
query = Explainer.where(language: nil) | ||
n = query.count | ||
i = 0 | ||
query.find_each do |explainer| | ||
i += 1 | ||
language = explainer.team&.get_language || 'und' | ||
explainer.update_column(:language, language) | ||
puts "[#{Time.now}] [#{i}/#{n}] Setting language for explainer ##{explainer.id} as #{language}" | ||
end | ||
minutes = ((Time.now.to_i - started) / 60).to_i | ||
puts "[#{Time.now}] Done in #{minutes} minutes. Number of explainers without language: #{query.count}" | ||
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