From 8262f94a1b1a588b02f0f6d3e3d832103579e294 Mon Sep 17 00:00:00 2001 From: Christopher Krailo Date: Tue, 15 Jul 2014 21:02:43 -0500 Subject: [PATCH 1/3] Remove elipsis from pagination bar. Part of issue #51. --- app/views/kaminari/_gap.html.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/kaminari/_gap.html.erb b/app/views/kaminari/_gap.html.erb index 33b9d7a..e72083d 100644 --- a/app/views/kaminari/_gap.html.erb +++ b/app/views/kaminari/_gap.html.erb @@ -5,4 +5,7 @@ per_page: number of items to fetch per page remote: data-remote -%> + \ No newline at end of file From 4740587680d8e97abb737dd03e5a7dfd70e5cc7c Mon Sep 17 00:00:00 2001 From: Christopher Krailo Date: Tue, 15 Jul 2014 21:25:07 -0500 Subject: [PATCH 2/3] Change epic_sort algorithm. This method should penalize people a ton if they don't have names and a little for each other profile piece they're missing. Part of issue #51. --- app/models/profile.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/models/profile.rb b/app/models/profile.rb index e0170c6..f77a032 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -41,7 +41,7 @@ def approve! self.update_attribute(:approved, true) end - def save_with_epic_sort(args={}) + def save_with_epic_sort(args={}) assign_attributes(args) epic_sort save @@ -50,9 +50,11 @@ def save_with_epic_sort(args={}) private def epic_sort return if organizer? - epic_length = 80 + Random.rand(20) - bio_length = blurb.present? ? blurb.length : 0 - score = (epic_length - bio_length).abs - self.sort_order = score + score = Random.rand(20) + score += 100 + Random.rand(20) if name.blank? + score += Random.rand(20) if blurb.blank? + score += Random.rand(20) if twitter.blank? + score += Random.rand(20) if homepage.blank? + self.sort_order = score end end From 45a45564aa11e16326a94f44f453b24d938f8bdd Mon Sep 17 00:00:00 2001 From: Scott Johnson <7.scott.j@gmail.com> Date: Wed, 16 Jul 2014 22:34:24 -0500 Subject: [PATCH 3/3] fix tests to match improved epic sort --- spec/models/profile_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb index 0c9cb59..e743594 100644 --- a/spec/models/profile_spec.rb +++ b/spec/models/profile_spec.rb @@ -27,14 +27,14 @@ @member.save_with_epic_sort @member.reload - @member.sort_order.should be_between(0, 20) + @member.sort_order.should be_between(0, 100) end it "should update attributes when saving with epic" do @member.save_with_epic_sort({blurb: @blurb, name: 'sample'}) @member.reload - @member.sort_order.should be_between(0, 20) + @member.sort_order.should be_between(0, 100) @member.name.should == 'sample' end @@ -52,8 +52,8 @@ @member.reload @member_2.reload - @member.sort_order.should be_between(0, 20) - @member_2.sort_order.should be_between(0, 20) + @member.sort_order.should be_between(0, 100) + @member_2.sort_order.should be_between(0, 100) end it "should not show non-organizers more than once" do