benhoskings-ambitious-activerecord 0.1.3.5 → 0.1.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,13 +4,13 @@
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = %q{ambitious-activerecord}
7
- s.version = "0.1.3.5"
7
+ s.version = "0.1.3.6"
8
8
 
9
9
  s.specification_version = 2 if s.respond_to? :specification_version=
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = ["Chris Wanstrath", "Ben Hoskings"]
13
- s.date = %q{2008-04-26}
13
+ s.date = %q{2009-04-16}
14
14
  s.description = %q{An ambitious adapter for ActiveRecord}
15
15
  s.email = %q{chris@ozmm.org, ben@hoskings.net}
16
16
  s.extra_rdoc_files = ["lib/ambition/adapters/active_record/base.rb", "lib/ambition/adapters/active_record/query.rb", "lib/ambition/adapters/active_record/select.rb", "lib/ambition/adapters/active_record/slice.rb", "lib/ambition/adapters/active_record/sort.rb", "lib/ambition/adapters/active_record/statements.rb", "lib/ambition/adapters/active_record.rb"]
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.test_files = ["test/chaining_test.rb", "test/count_test.rb", "test/enumerable_test.rb", "test/join_test.rb", "test/ruby_test.rb", "test/select_test.rb", "test/slice_test.rb", "test/sort_test.rb", "test/source_test.rb", "test/types_test.rb"]
26
26
 
27
27
  s.add_dependency(%q<activerecord>, [">= 1.15.6"])
28
- s.add_dependency(%q<benhoskings-ambition>, [">= 0.5.4.3"])
28
+ s.add_dependency(%q<benhoskings-ambition>, ["~> 0.5.4.3"])
29
29
  end
30
30
 
31
31
 
@@ -21,10 +21,11 @@ module Ambition
21
21
  with_context_scope(to_hash) { owner.paginate *args }
22
22
  end
23
23
 
24
- def within outer_scope, join_association
24
+ def within outer_scope, join_association = nil
25
25
  context = ambition_context
26
26
 
27
27
  unless outer_scope.nil?
28
+ join_association ||= outer_scope.owner.symbolize
28
29
  raise "#{owner} doesn't have a #{join_association.inspect} association. Make sure it's spelt and pluralized correctly and speficied as a symbol." unless context.owner.reflections.has_key?(join_association)
29
30
 
30
31
  (context.stash[:joins] ||= []).push(join_association).concat(outer_scope.stash[:joins] || []).uniq!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benhoskings-ambitious-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.5
4
+ version: 0.1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2008-04-26 00:00:00 -07:00
13
+ date: 2009-04-16 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -29,7 +29,7 @@ dependencies:
29
29
  version_requirement:
30
30
  version_requirements: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - ~>
33
33
  - !ruby/object:Gem::Version
34
34
  version: 0.5.4.3
35
35
  version: