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 (broken) cii experiment #1385

Merged
merged 3 commits into from
Apr 28, 2017
Merged

Add (broken) cii experiment #1385

merged 3 commits into from
Apr 28, 2017

Conversation

BenJam
Copy link
Contributor

@BenJam BenJam commented Apr 28, 2017

Todo

  • fix pg query syntax
  • double check render
  • add test

Todo

* fix pg query syntax
* double check render
@BenJam
Copy link
Contributor Author

BenJam commented Apr 28, 2017

@andrew would be good to understand what's happening with the db qry here. Tripping up on projets_controller#digital_infrastructure ln 144. But I'm certain this is due to project.rb ln 80 but I took the query for the rake task.

scope :digital_infrastructure, -> { not_removed
.with_dependent_repos
.with_repo
.where('projects.dependent_repos_count DESC NULLS LAST').limit(1000)}
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be .order, rather than .where at the start of this line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

def unseen_infrastructure
orginal_scope = Project.unsung_heroes
scope = current_platform.present? ? orginal_scope.platform(current_platform) : orginal_scope
@projects = scope.order('projects.dependent_repos_count DESC').paginate(page: page_number)
@platforms = orginal_scope.group('projects.platform').count.reject{|k,_v| k.blank? }.sort_by{|_k,v| v }.reverse.first(20)
@platforms = orginal_scope.group('projects.platform').count.reject{|k,_v|÷ k.blank? }.sort_by{|_k,v| v }.reverse.first(20)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Weird percentage symbol on this line that needs to be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🥇

@BenJam
Copy link
Contributor Author

BenJam commented Apr 28, 2017

Tak!

@andrew andrew merged commit 35a930c into master Apr 28, 2017
@andrew andrew deleted the cii branch April 28, 2017 18:46
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

Successfully merging this pull request may close these issues.

None yet

2 participants