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 +2 -2
- data/lib/schema_associations/active_record/associations.rb +1 -1
- data/lib/schema_associations/version.rb +1 -1
- data/runspecs +2 -2
- data/schema_associations.gemspec +3 -1
- data/spec/association_spec.rb +16 -13
- metadata +3 -3
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
|
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:
|
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
|
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}"
|
data/schema_associations.gemspec
CHANGED
@@ -21,7 +21,9 @@ Gem::Specification.new do |s|
|
|
21
21
|
|
22
22
|
s.add_dependency("schema_plus")
|
23
23
|
|
24
|
-
case ENV['
|
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'
|
data/spec/association_spec.rb
CHANGED
@@ -489,22 +489,25 @@ describe ActiveRecord::Base do
|
|
489
489
|
end
|
490
490
|
end
|
491
491
|
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
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
|
-
|
503
|
-
|
504
|
-
|
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
|
-
|
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
|
-
-
|
9
|
-
version: 0.1.
|
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-
|
18
|
+
date: 2011-07-27 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|