composite_primary_keys 2.2.2 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +8 -0
- data/Rakefile +1 -1
- data/lib/composite_primary_keys.rb +2 -0
- data/lib/composite_primary_keys/version.rb +1 -1
- data/test/abstract_unit.rb +3 -1
- data/test/test_associations.rb +1 -1
- data/test/test_attribute_methods.rb +1 -1
- data/test/test_attributes.rb +1 -1
- data/test/test_clone.rb +1 -1
- data/test/test_composite_arrays.rb +1 -1
- data/test/test_create.rb +1 -1
- data/test/test_delete.rb +1 -1
- data/test/test_dummy.rb +1 -1
- data/test/test_exists.rb +1 -1
- data/test/test_find.rb +1 -1
- data/test/test_ids.rb +1 -1
- data/test/test_miscellaneous.rb +1 -1
- data/test/test_pagination.rb +1 -1
- data/test/test_polymorphic.rb +1 -1
- data/test/test_santiago.rb +1 -1
- data/test/test_tutorial_examle.rb +1 -1
- data/test/test_update.rb +1 -1
- data/tmp/test.db +0 -0
- data/website/index.html +9 -13
- data/website/version-raw.js +1 -1
- data/website/version.js +1 -1
- metadata +8 -7
data/History.txt
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
== 2.3.2 2009-07-16
|
2
|
+
|
3
|
+
* explicitly load associations.rb due to some getting an unitialized constant error
|
4
|
+
|
5
|
+
== 2.3.2 2009-05-28
|
6
|
+
|
7
|
+
* get tests working again with AR 2.3.2
|
8
|
+
|
1
9
|
== 2.2.1 2009-01-21
|
2
10
|
|
3
11
|
* fix ActiveRecord#exists? to work when passing conditions instead of ids
|
data/Rakefile
CHANGED
@@ -52,7 +52,7 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
|
52
52
|
|
53
53
|
# == Optional
|
54
54
|
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
55
|
-
p.extra_deps = [['activerecord', '>= 2.2
|
55
|
+
p.extra_deps = [['activerecord', '>= 2.3.2']] #An array of rubygem dependencies.
|
56
56
|
#p.spec_extras - A hash of extra values to set in the gemspec.
|
57
57
|
end
|
58
58
|
|
data/test/abstract_unit.rb
CHANGED
@@ -15,7 +15,9 @@ require 'composite_primary_keys'
|
|
15
15
|
|
16
16
|
QUOTED_TYPE = ActiveRecord::Base.connection.quote_column_name('type') unless Object.const_defined?(:QUOTED_TYPE)
|
17
17
|
|
18
|
-
class
|
18
|
+
class ActiveSupport::TestCase #:nodoc:
|
19
|
+
include ActiveRecord::TestFixtures
|
20
|
+
|
19
21
|
self.fixture_path = File.dirname(__FILE__) + "/fixtures/"
|
20
22
|
self.use_instantiated_fixtures = false
|
21
23
|
self.use_transactional_fixtures = true
|
data/test/test_associations.rb
CHANGED
@@ -15,7 +15,7 @@ require 'fixtures/room_assignment'
|
|
15
15
|
require 'fixtures/user'
|
16
16
|
require 'fixtures/reading'
|
17
17
|
|
18
|
-
class TestAssociations <
|
18
|
+
class TestAssociations < ActiveSupport::TestCase
|
19
19
|
fixtures :articles, :products, :tariffs, :product_tariffs, :suburbs, :streets, :restaurants, :restaurants_suburbs,
|
20
20
|
:dorms, :rooms, :room_attributes, :room_attribute_assignments, :students, :room_assignments, :users, :readings
|
21
21
|
|
@@ -2,7 +2,7 @@ require 'abstract_unit'
|
|
2
2
|
require 'fixtures/kitchen_sink'
|
3
3
|
require 'fixtures/reference_type'
|
4
4
|
|
5
|
-
class TestAttributeMethods <
|
5
|
+
class TestAttributeMethods < ActiveSupport::TestCase
|
6
6
|
fixtures :kitchen_sinks, :reference_types
|
7
7
|
|
8
8
|
def test_read_attribute_with_single_key
|
data/test/test_attributes.rb
CHANGED
@@ -5,7 +5,7 @@ require 'fixtures/product'
|
|
5
5
|
require 'fixtures/tariff'
|
6
6
|
require 'fixtures/product_tariff'
|
7
7
|
|
8
|
-
class TestAttributes <
|
8
|
+
class TestAttributes < ActiveSupport::TestCase
|
9
9
|
fixtures :reference_types, :reference_codes, :products, :tariffs, :product_tariffs
|
10
10
|
|
11
11
|
CLASSES = {
|
data/test/test_clone.rb
CHANGED
@@ -2,7 +2,7 @@ require 'abstract_unit'
|
|
2
2
|
require 'fixtures/reference_type'
|
3
3
|
require 'fixtures/reference_code'
|
4
4
|
|
5
|
-
class CompositeArraysTest <
|
5
|
+
class CompositeArraysTest < ActiveSupport::TestCase
|
6
6
|
|
7
7
|
def test_new_primary_keys
|
8
8
|
keys = CompositePrimaryKeys::CompositeKeys.new
|
data/test/test_create.rb
CHANGED
data/test/test_delete.rb
CHANGED
@@ -4,7 +4,7 @@ require 'fixtures/reference_code'
|
|
4
4
|
require 'fixtures/department'
|
5
5
|
require 'fixtures/employee'
|
6
6
|
|
7
|
-
class TestDelete <
|
7
|
+
class TestDelete < ActiveSupport::TestCase
|
8
8
|
fixtures :reference_types, :reference_codes, :departments, :employees
|
9
9
|
|
10
10
|
CLASSES = {
|
data/test/test_dummy.rb
CHANGED
data/test/test_exists.rb
CHANGED
data/test/test_find.rb
CHANGED
@@ -3,7 +3,7 @@ require 'fixtures/reference_type'
|
|
3
3
|
require 'fixtures/reference_code'
|
4
4
|
|
5
5
|
# Testing the find action on composite ActiveRecords with two primary keys
|
6
|
-
class TestFind <
|
6
|
+
class TestFind < ActiveSupport::TestCase
|
7
7
|
fixtures :reference_types, :reference_codes
|
8
8
|
|
9
9
|
CLASSES = {
|
data/test/test_ids.rb
CHANGED
data/test/test_miscellaneous.rb
CHANGED
@@ -2,7 +2,7 @@ require 'abstract_unit'
|
|
2
2
|
require 'fixtures/reference_type'
|
3
3
|
require 'fixtures/reference_code'
|
4
4
|
|
5
|
-
class TestMiscellaneous <
|
5
|
+
class TestMiscellaneous < ActiveSupport::TestCase
|
6
6
|
fixtures :reference_types, :reference_codes, :products
|
7
7
|
|
8
8
|
CLASSES = {
|
data/test/test_pagination.rb
CHANGED
@@ -3,7 +3,7 @@ require 'fixtures/reference_type'
|
|
3
3
|
require 'fixtures/reference_code'
|
4
4
|
require 'plugins/pagination'
|
5
5
|
|
6
|
-
class TestPagination <
|
6
|
+
class TestPagination < ActiveSupport::TestCase
|
7
7
|
fixtures :reference_types, :reference_codes
|
8
8
|
|
9
9
|
include ActionController::Pagination
|
data/test/test_polymorphic.rb
CHANGED
data/test/test_santiago.rb
CHANGED
@@ -6,7 +6,7 @@ require 'fixtures/user'
|
|
6
6
|
require 'fixtures/article'
|
7
7
|
require 'fixtures/reading'
|
8
8
|
|
9
|
-
class TestSantiago <
|
9
|
+
class TestSantiago < ActiveSupport::TestCase
|
10
10
|
fixtures :suburbs, :streets, :users, :articles, :readings
|
11
11
|
|
12
12
|
def test_normal_and_composite_associations
|
@@ -4,7 +4,7 @@ require 'fixtures/group'
|
|
4
4
|
require 'fixtures/membership_status'
|
5
5
|
require 'fixtures/membership'
|
6
6
|
|
7
|
-
class TestTutorialExample <
|
7
|
+
class TestTutorialExample < ActiveSupport::TestCase
|
8
8
|
fixtures :users, :groups, :memberships, :membership_statuses
|
9
9
|
|
10
10
|
def test_membership
|
data/test/test_update.rb
CHANGED
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">2.
|
36
|
+
<a href="http://rubyforge.org/projects/compositekeys" class="numbers">2.3.2</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ Ruby on Rails</h1>
|
39
39
|
<h1>→ ActiveRecords</h1>
|
@@ -98,15 +98,12 @@ throughout your application. Just like a normal ActiveRecord.</p>
|
|
98
98
|
and I didn’t see any information about what I should do to address it in the<br />
|
99
99
|
documentation (might have missed it).</p>
|
100
100
|
<p>The problem was that the urls being generated for a ‘show’ action (for<br />
|
101
|
-
example) had a syntax like
|
102
|
-
|
103
|
-
<pre>/controller/show/123000,Bu70</pre></p>
|
101
|
+
example) had a syntax like:</p>
|
102
|
+
<p><pre>/controller/show/123000,Bu70</pre></p>
|
104
103
|
<p>for a two-field composite PK. The default routing would not match that,<br />
|
105
|
-
so after working out how to do the routing I added
|
106
|
-
|
107
|
-
|
108
|
-
<br />
|
109
|
-
to my <code>route.rb</code> file.</p>
|
104
|
+
so after working out how to do the routing I added:</p>
|
105
|
+
<p><pre class="syntax"><span class="ident">map</span><span class="punct">.</span><span class="ident">connect</span> <span class="punct">'</span><span class="string">:controller/:action/:id</span><span class="punct">',</span> <span class="symbol">:id</span> <span class="punct">=></span> <span class="punct">/</span><span class="regex"><span class="escape">\w</span>+(,<span class="escape">\w</span>+)*</span><span class="punct">/</span></pre></p>
|
106
|
+
<p>to my <code>route.rb</code> file.</p>
|
110
107
|
</blockquote>
|
111
108
|
<p><a name="dbs"></a></p>
|
112
109
|
<h2>Which databases?</h2>
|
@@ -175,15 +172,14 @@ other stories and things.</p>
|
|
175
172
|
<p><a href="http://groups.google.com/group/compositekeys">http://groups.google.com/group/compositekeys</a></p>
|
176
173
|
<h2>How to submit patches</h2>
|
177
174
|
<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people’s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
|
178
|
-
<p>The source for this project is available via git. You can <a href="http://github.com/drnic/composite_primary_keys/tree/master">browse and/or fork the source</a>, or to clone the project locally
|
179
|
-
|
180
|
-
<pre>git clone git://github.com/drnic/composite_primary_keys.git</pre></p>
|
175
|
+
<p>The source for this project is available via git. You can <a href="http://github.com/drnic/composite_primary_keys/tree/master">browse and/or fork the source</a>, or to clone the project locally:</p>
|
176
|
+
<pre>git clone git://github.com/drnic/composite_primary_keys.git</pre>
|
181
177
|
<h2>Licence</h2>
|
182
178
|
<p>This code is free to use under the terms of the <span class="caps">MIT</span> licence.</p>
|
183
179
|
<h2>Contact</h2>
|
184
180
|
<p>Comments are welcome. Send an email to <a href="mailto:drnicwilliams@gmail.com">Dr Nic Williams</a>.</p>
|
185
181
|
<p class="coda">
|
186
|
-
<a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>,
|
182
|
+
<a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 16th July 2009<br>
|
187
183
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
188
184
|
</p>
|
189
185
|
</div>
|
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: 2.
|
4
|
+
version: 2.3.2
|
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: 2009-
|
12
|
+
date: 2009-07-16 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 2.2
|
23
|
+
version: 2.3.2
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: hoe
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.3.2
|
34
34
|
version:
|
35
35
|
description: Composite key support for ActiveRecords
|
36
36
|
email: drnicwilliams@gmail.com
|
@@ -43,7 +43,6 @@ extra_rdoc_files:
|
|
43
43
|
- Manifest.txt
|
44
44
|
- README.txt
|
45
45
|
- README_DB2.txt
|
46
|
-
- test/README_tests.txt
|
47
46
|
- website/index.txt
|
48
47
|
- website/version-raw.txt
|
49
48
|
- website/version.txt
|
@@ -172,6 +171,8 @@ files:
|
|
172
171
|
- website/version.txt
|
173
172
|
has_rdoc: true
|
174
173
|
homepage: http://compositekeys.rubyforge.org
|
174
|
+
licenses: []
|
175
|
+
|
175
176
|
post_install_message:
|
176
177
|
rdoc_options:
|
177
178
|
- --main
|
@@ -193,9 +194,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
194
|
requirements: []
|
194
195
|
|
195
196
|
rubyforge_project: compositekeys
|
196
|
-
rubygems_version: 1.3.
|
197
|
+
rubygems_version: 1.3.4
|
197
198
|
signing_key:
|
198
|
-
specification_version:
|
199
|
+
specification_version: 3
|
199
200
|
summary: Composite key support for ActiveRecords
|
200
201
|
test_files:
|
201
202
|
- test/test_associations.rb
|