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.
@@ -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.0']] #An array of rubygem dependencies.
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
 
@@ -33,6 +33,8 @@ unless defined?(ActiveRecord)
33
33
  end
34
34
  end
35
35
 
36
+ load 'active_record/associations.rb'
37
+
36
38
  require 'composite_primary_keys/fixtures'
37
39
  require 'composite_primary_keys/composite_arrays'
38
40
  require 'composite_primary_keys/associations'
@@ -1,7 +1,7 @@
1
1
  module CompositePrimaryKeys
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 2
4
- MINOR = 2
4
+ MINOR = 3
5
5
  TINY = 2
6
6
  STRING = [MAJOR, MINOR, TINY].join('.')
7
7
  end
@@ -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 Test::Unit::TestCase #:nodoc:
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
@@ -15,7 +15,7 @@ require 'fixtures/room_assignment'
15
15
  require 'fixtures/user'
16
16
  require 'fixtures/reading'
17
17
 
18
- class TestAssociations < Test::Unit::TestCase
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 < Test::Unit::TestCase
5
+ class TestAttributeMethods < ActiveSupport::TestCase
6
6
  fixtures :kitchen_sinks, :reference_types
7
7
 
8
8
  def test_read_attribute_with_single_key
@@ -5,7 +5,7 @@ require 'fixtures/product'
5
5
  require 'fixtures/tariff'
6
6
  require 'fixtures/product_tariff'
7
7
 
8
- class TestAttributes < Test::Unit::TestCase
8
+ class TestAttributes < ActiveSupport::TestCase
9
9
  fixtures :reference_types, :reference_codes, :products, :tariffs, :product_tariffs
10
10
 
11
11
  CLASSES = {
@@ -2,7 +2,7 @@ require 'abstract_unit'
2
2
  require 'fixtures/reference_type'
3
3
  require 'fixtures/reference_code'
4
4
 
5
- class TestClone < Test::Unit::TestCase
5
+ class TestClone < ActiveSupport::TestCase
6
6
  fixtures :reference_types, :reference_codes
7
7
 
8
8
  CLASSES = {
@@ -2,7 +2,7 @@ require 'abstract_unit'
2
2
  require 'fixtures/reference_type'
3
3
  require 'fixtures/reference_code'
4
4
 
5
- class CompositeArraysTest < Test::Unit::TestCase
5
+ class CompositeArraysTest < ActiveSupport::TestCase
6
6
 
7
7
  def test_new_primary_keys
8
8
  keys = CompositePrimaryKeys::CompositeKeys.new
@@ -4,7 +4,7 @@ require 'fixtures/reference_code'
4
4
  require 'fixtures/street'
5
5
  require 'fixtures/suburb'
6
6
 
7
- class TestCreate < Test::Unit::TestCase
7
+ class TestCreate < ActiveSupport::TestCase
8
8
  fixtures :reference_types, :reference_codes, :streets, :suburbs
9
9
 
10
10
  CLASSES = {
@@ -4,7 +4,7 @@ require 'fixtures/reference_code'
4
4
  require 'fixtures/department'
5
5
  require 'fixtures/employee'
6
6
 
7
- class TestDelete < Test::Unit::TestCase
7
+ class TestDelete < ActiveSupport::TestCase
8
8
  fixtures :reference_types, :reference_codes, :departments, :employees
9
9
 
10
10
  CLASSES = {
@@ -2,7 +2,7 @@ require 'abstract_unit'
2
2
  require 'fixtures/reference_type'
3
3
  require 'fixtures/reference_code'
4
4
 
5
- class TestDummy < Test::Unit::TestCase
5
+ class TestDummy < ActiveSupport::TestCase
6
6
  fixtures :reference_types, :reference_codes
7
7
 
8
8
  classes = {
@@ -2,7 +2,7 @@ require 'abstract_unit'
2
2
  require 'fixtures/article'
3
3
  require 'fixtures/department'
4
4
 
5
- class TestExists < Test::Unit::TestCase
5
+ class TestExists < ActiveSupport::TestCase
6
6
  fixtures :articles, :departments
7
7
 
8
8
  def test_single_key_exists_giving_id
@@ -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 < Test::Unit::TestCase
6
+ class TestFind < ActiveSupport::TestCase
7
7
  fixtures :reference_types, :reference_codes
8
8
 
9
9
  CLASSES = {
@@ -2,7 +2,7 @@ require 'abstract_unit'
2
2
  require 'fixtures/reference_type'
3
3
  require 'fixtures/reference_code'
4
4
 
5
- class TestIds < Test::Unit::TestCase
5
+ class TestIds < ActiveSupport::TestCase
6
6
  fixtures :reference_types, :reference_codes
7
7
 
8
8
  CLASSES = {
@@ -2,7 +2,7 @@ require 'abstract_unit'
2
2
  require 'fixtures/reference_type'
3
3
  require 'fixtures/reference_code'
4
4
 
5
- class TestMiscellaneous < Test::Unit::TestCase
5
+ class TestMiscellaneous < ActiveSupport::TestCase
6
6
  fixtures :reference_types, :reference_codes, :products
7
7
 
8
8
  CLASSES = {
@@ -3,7 +3,7 @@ require 'fixtures/reference_type'
3
3
  require 'fixtures/reference_code'
4
4
  require 'plugins/pagination'
5
5
 
6
- class TestPagination < Test::Unit::TestCase
6
+ class TestPagination < ActiveSupport::TestCase
7
7
  fixtures :reference_types, :reference_codes
8
8
 
9
9
  include ActionController::Pagination
@@ -4,7 +4,7 @@ require 'fixtures/user'
4
4
  require 'fixtures/employee'
5
5
  require 'fixtures/hack'
6
6
 
7
- class TestPolymorphic < Test::Unit::TestCase
7
+ class TestPolymorphic < ActiveSupport::TestCase
8
8
  fixtures :users, :employees, :comments, :hacks
9
9
 
10
10
  def test_polymorphic_has_many
@@ -6,7 +6,7 @@ require 'fixtures/user'
6
6
  require 'fixtures/article'
7
7
  require 'fixtures/reading'
8
8
 
9
- class TestSantiago < Test::Unit::TestCase
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 < Test::Unit::TestCase
7
+ class TestTutorialExample < ActiveSupport::TestCase
8
8
  fixtures :users, :groups, :memberships, :membership_statuses
9
9
 
10
10
  def test_membership
@@ -2,7 +2,7 @@ require 'abstract_unit'
2
2
  require 'fixtures/reference_type'
3
3
  require 'fixtures/reference_code'
4
4
 
5
- class TestUpdate < Test::Unit::TestCase
5
+ class TestUpdate < ActiveSupport::TestCase
6
6
  fixtures :reference_types, :reference_codes
7
7
 
8
8
  CLASSES = {
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">2.2.2</a>
36
+ <a href="http://rubyforge.org/projects/compositekeys" class="numbers">2.3.2</a>
37
37
  </div>
38
38
  <h1>&#8594; Ruby on Rails</h1>
39
39
  <h1>&#8594; ActiveRecords</h1>
@@ -98,15 +98,12 @@ throughout your application. Just like a normal ActiveRecord.</p>
98
98
  and I didn&#8217;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 &#8216;show&#8217; action (for<br />
101
- example) had a syntax like:<br />
102
- <br />
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:<br />
106
- <br />
107
- <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">=&gt;</span> <span class="punct">/</span><span class="regex"><span class="escape">\w</span>+(,<span class="escape">\w</span>+)*</span><span class="punct">/</span></pre><br />
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">=&gt;</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&#8217;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:<br />
179
- <br />
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>, 21st January 2009<br>
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>
@@ -1,3 +1,3 @@
1
1
  // Announcement JS file
2
- var version = "2.2.2";
2
+ var version = "2.3.2";
3
3
  MagicAnnouncement.show('compositekeys', version);
@@ -1,4 +1,4 @@
1
1
  // Version JS file
2
- var version = "2.2.2";
2
+ var version = "2.3.2";
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: 2.2.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-01-24 00:00:00 -06:00
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.0
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: 1.8.3
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.1
197
+ rubygems_version: 1.3.4
197
198
  signing_key:
198
- specification_version: 2
199
+ specification_version: 3
199
200
  summary: Composite key support for ActiveRecords
200
201
  test_files:
201
202
  - test/test_associations.rb