schema_associations 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -227,7 +227,7 @@ use cases that you logged).
227
227
  == Compatibility
228
228
 
229
229
  SchemaAssociations supports all combinations of:
230
- * rails 3.0 or 3.1 (prerelease)
230
+ * rails 2.3, 3.0 or 3.1 (prerelease)
231
231
  * MRI ruby 1.8.7 or 1.9.2
232
232
 
233
233
  == Installation
@@ -266,4 +266,4 @@ If you're running ruby 1.9.2, code coverage results will be in coverage/index.ht
266
266
 
267
267
  == License
268
268
 
269
- This plugin is released under the MIT license.
269
+ This gem is released under the MIT license.
@@ -20,7 +20,7 @@ module SchemaAssociations
20
20
  alias_method_chain :reflect_on_association, :schema_associations
21
21
  alias_method_chain :reflect_on_all_associations, :schema_associations
22
22
  end
23
- ::ActiveRecord::Relation.send :include, Relation
23
+ ::ActiveRecord::Relation.send :include, Relation if defined? ::ActiveRecord::Relation
24
24
  end
25
25
 
26
26
  def reflect_on_association_with_schema_associations(*args) #:nodoc:
@@ -1,3 +1,3 @@
1
1
  module SchemaAssociations
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/runspecs CHANGED
@@ -3,7 +3,7 @@
3
3
  require 'optparse'
4
4
 
5
5
  RUBY_VERSIONS = %W[1.8.7 1.9.2]
6
- RAILS_VERSIONS = %W[3.0 3.1]
6
+ RAILS_VERSIONS = %W[2.3 3.0 3.1]
7
7
 
8
8
  options = {}
9
9
  OptionParser.new do |opts|
@@ -28,7 +28,7 @@ RUBY_VERSIONS.each do |ruby|
28
28
  n += 1
29
29
  allcmds = []
30
30
  allcmds << "rvm use #{ruby}"
31
- allcmds << "export SCHEMA_VALIDATIONS_RAILS_VERSION=#{rails}"
31
+ allcmds << "export SCHEMA_ASSOCIATIONS_RAILS_VERSION=#{rails}"
32
32
  allcmds += cmds
33
33
  allcmds << 'exit'
34
34
  system %Q{echo '#{allcmds.join(' \n ')}' | bash -i} or abort "aborting #{$0}"
@@ -21,7 +21,9 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.add_dependency("schema_plus")
23
23
 
24
- case ENV['SCHEMA_ASSOCIATION_RAILS_VERSION']
24
+ case ENV['SCHEMA_ASSOCIATIONS_RAILS_VERSION']
25
+ when '2.3'
26
+ s.add_development_dependency("rails", "~> 2.3")
25
27
  when '3.0'
26
28
  s.add_development_dependency("rails", "~> 3.0")
27
29
  when '3.1'
@@ -489,22 +489,25 @@ describe ActiveRecord::Base do
489
489
  end
490
490
  end
491
491
 
492
- context "regarding relations" do
493
- before(:each) do
494
- create_tables(
495
- "posts", {}, {},
496
- "comments", {}, { :post_id => {} }
497
- )
498
- class Post < ActiveRecord::Base ; end
499
- class Comment < ActiveRecord::Base ; end
500
- end
492
+ if defined? ::ActiveRecord::Relation
493
+
494
+ context "regarding relations" do
495
+ before(:each) do
496
+ create_tables(
497
+ "posts", {}, {},
498
+ "comments", {}, { :post_id => {} }
499
+ )
500
+ class Post < ActiveRecord::Base ; end
501
+ class Comment < ActiveRecord::Base ; end
502
+ end
501
503
 
502
- it "should define associations before needed by relation" do
503
- Post.joins(:comments).all
504
- expect { Post.joins(:comments).all }.should_not raise_error
504
+ it "should define associations before needed by relation" do
505
+ Post.joins(:comments).all
506
+ expect { Post.joins(:comments).all }.should_not raise_error
505
507
 
506
- end
508
+ end
507
509
 
510
+ end
508
511
  end
509
512
 
510
513
  protected
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ronen Barzel
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-26 00:00:00 +02:00
18
+ date: 2011-07-27 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency