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.
- data/History.txt +4 -0
- data/lib/composite_primary_keys/calculations.rb +2 -2
- data/lib/composite_primary_keys/version.rb +1 -1
- data/test/test_associations.rb +1 -0
- data/tmp/test.db +0 -0
- data/website/index.html +1 -1
- data/website/version-raw.js +1 -1
- data/website/version.js +1 -1
- metadata +2 -2
data/History.txt
CHANGED
@@ -43,13 +43,13 @@ module CompositePrimaryKeys
|
|
43
43
|
((scope && scope[:limit]) || options[:limit])
|
44
44
|
|
45
45
|
if options[:group]
|
46
|
-
group_key =
|
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
|
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
|
data/test/test_associations.rb
CHANGED
@@ -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
|
data/tmp/test.db
CHANGED
Binary file
|
data/website/index.html
CHANGED
@@ -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.
|
36
|
+
<a href="http://rubyforge.org/projects/compositekeys" class="numbers">1.0.5</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ Ruby on Rails</h1>
|
39
39
|
|
data/website/version-raw.js
CHANGED
data/website/version.js
CHANGED
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
|
+
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-
|
12
|
+
date: 2008-07-25 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|