Skip to content
This repository has been archived by the owner on Apr 9, 2019. It is now read-only.

Commit

Permalink
cohort_scope -> cohort_analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
seamusabshere committed May 21, 2012
1 parent 8f20b4c commit ed477d1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 1 addition & 3 deletions test/helper.rb
@@ -1,7 +1,7 @@
require 'bundler/setup'
require 'minitest/spec'
require 'minitest/autorun'
require 'cohort_scope'
require 'cohort_analysis'

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
Expand Down Expand Up @@ -223,8 +223,6 @@ class MiniTest::Unit::TestCase
class Segment < ActiveRecord::Base
set_primary_key :row_hash
validates_presence_of :row_hash
extend CohortScope
self.minimum_cohort_size = 1
belongs_to :aircraft, :foreign_key => 'bts_aircraft_type', :primary_key => 'bts_aircraft_type'
has_one :aircraft_class, :through => :aircraft
end
Expand Down
4 changes: 2 additions & 2 deletions test/test_weighted_average.rb
Expand Up @@ -186,8 +186,8 @@

it "does custom weighting, with a cohort" do
should_have_same_sql(
"SELECT (SUM(1.0 * (segments.load_factor) * segments.passengers) / SUM(segments.passengers)) AS weighted_average FROM segments WHERE segments.payload = 5 AND (segments.load_factor IS NOT NULL) AND (segments.passengers > 0)",
Segment.big_cohort(:payload => 5).weighted_average_relation(:load_factor, :weighted_by => :passengers)
"SELECT (SUM(1.0 * (segments.load_factor) * segments.passengers) / SUM(segments.passengers)) AS weighted_average FROM segments WHERE (segments.payload = 5) AND (segments.load_factor IS NOT NULL) AND (segments.passengers > 0)",
Segment.cohort(:payload => 5).weighted_average_relation(:load_factor, :weighted_by => :passengers)
)
end

Expand Down
5 changes: 2 additions & 3 deletions weighted_average.gemspec
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "weighted_average/version"
require File.expand_path("../lib/weighted_average/version", __FILE__)

Gem::Specification.new do |s|
s.name = "weighted_average"
Expand All @@ -22,7 +21,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'activesupport', '~>3'
s.add_runtime_dependency 'arel', '>= 2'

s.add_development_dependency 'cohort_scope', '>= 0.2.1'
s.add_development_dependency 'cohort_analysis', '>= 0.2.1'
s.add_development_dependency 'minitest'
s.add_development_dependency 'rake'
s.add_development_dependency 'mysql'
Expand Down

0 comments on commit ed477d1

Please sign in to comment.