composite_primary_keys 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,7 @@
1
+ == 1.0.5 2008-07-25
2
+
3
+ * fix for calculations with a group by clause [thx Sirius Black]
4
+
1
5
  == 1.0.4 2008-07-15
2
6
 
3
7
  * support for oracle_enhanced adapter [thx Raimonds Simanovskis]
@@ -43,13 +43,13 @@ module CompositePrimaryKeys
43
43
  ((scope && scope[:limit]) || options[:limit])
44
44
 
45
45
  if options[:group]
46
- group_key = Base.connection.adapter_name == 'FrontBase' ? :group_alias : :group_field
46
+ group_key = connection.adapter_name == 'FrontBase' ? :group_alias : :group_field
47
47
  sql << " GROUP BY #{options[group_key]} "
48
48
  end
49
49
 
50
50
  if options[:group] && options[:having]
51
51
  # FrontBase requires identifiers in the HAVING clause and chokes on function calls
52
- if Base.connection.adapter_name == 'FrontBase'
52
+ if connection.adapter_name == 'FrontBase'
53
53
  options[:having].downcase!
54
54
  options[:having].gsub!(/#{operation}\s*\(\s*#{column_name}\s*\)/, aggregate_alias)
55
55
  end
@@ -2,7 +2,7 @@ module CompositePrimaryKeys
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
- TINY = 3
5
+ TINY = 5
6
6
  STRING = [MAJOR, MINOR, TINY].join('.')
7
7
  end
8
8
  end
@@ -45,6 +45,7 @@ class TestAssociations < Test::Unit::TestCase
45
45
  def test_count
46
46
  assert_equal 2, Product.count(:include => :product_tariffs)
47
47
  assert_equal 3, Tariff.count(:include => :product_tariffs)
48
+ assert_equal 2, Tariff.count(:group => :start_date).size
48
49
  end
49
50
 
50
51
  def test_products
Binary file
@@ -33,7 +33,7 @@
33
33
  <h1>Composite Primary Keys</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/compositekeys"; return false'>
35
35
  Get Version
36
- <a href="http://rubyforge.org/projects/compositekeys" class="numbers">1.0.3</a>
36
+ <a href="http://rubyforge.org/projects/compositekeys" class="numbers">1.0.5</a>
37
37
  </div>
38
38
  <h1>&#x2192; Ruby on Rails</h1>
39
39
 
@@ -1,3 +1,3 @@
1
1
  // Announcement JS file
2
- var version = "1.0.3";
2
+ var version = "1.0.5";
3
3
  MagicAnnouncement.show('compositekeys', version);
@@ -1,4 +1,4 @@
1
1
  // Version JS file
2
- var version = "1.0.3";
2
+ var version = "1.0.5";
3
3
 
4
4
  document.write(" - " + version);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: composite_primary_keys
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dr Nic Williams
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-07-15 00:00:00 -05:00
12
+ date: 2008-07-25 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency