meta_search 0.9.7 → 0.9.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ Changes since 0.9.7 (2010-10-12):
2
+ * Play nicely regardless of MetaWhere/MetaSearch load order.
3
+
1
4
  Changes since 0.9.6 (2010-09-29):
2
5
  * Support _or_-separated conditions. I'm not crazy about 'em, but it's
3
6
  an oft-requested feature.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.7
1
+ 0.9.7.1
@@ -257,7 +257,7 @@ module MetaSearch
257
257
  assoc.parent == parent
258
258
  end
259
259
  unless found_association
260
- @join_dependency.send(:build, association, parent, Arel::OuterJoin, klass)
260
+ @join_dependency.send(:build_with_metasearch, association, parent, Arel::OuterJoin, klass)
261
261
  found_association = @join_dependency.join_associations.last
262
262
  @relation = @relation.joins(found_association)
263
263
  end
@@ -4,7 +4,6 @@ module MetaSearch
4
4
 
5
5
  def self.included(base)
6
6
  base.class_eval do
7
- alias_method_chain :build, :metasearch
8
7
  alias_method_chain :graft, :metasearch
9
8
  end
10
9
  end
@@ -12,7 +11,11 @@ module MetaSearch
12
11
  def graft_with_metasearch(*associations)
13
12
  associations.each do |association|
14
13
  join_associations.detect {|a| association == a} ||
15
- build(association.reflection.name, association.find_parent_in(self) || join_base, association.join_class, association.reflection.klass)
14
+ (
15
+ association.class == MetaSearch::PolymorphicJoinAssociation ?
16
+ build_with_metasearch(association.reflection.name, association.find_parent_in(self) || join_base, association.join_class, association.reflection.klass) :
17
+ build(association.reflection.name, association.find_parent_in(self) || join_base, association.join_class)
18
+ )
16
19
  end
17
20
  self
18
21
  end
@@ -33,7 +36,7 @@ module MetaSearch
33
36
  @joins << build_join_association(reflection, parent).with_join_class(join_class)
34
37
  end
35
38
  else
36
- build_without_metasearch(association, parent, join_class)
39
+ build(association, parent, join_class) # Shouldn't get here.
37
40
  end
38
41
  end
39
42
 
data/meta_search.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{meta_search}
8
- s.version = "0.9.7"
8
+ s.version = "0.9.7.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ernie Miller"]
12
- s.date = %q{2010-10-11}
12
+ s.date = %q{2010-10-12}
13
13
  s.description = %q{
14
14
  Allows simple search forms to be created against an AR3 model
15
15
  and its associations, has useful view helpers for sort links
metadata CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 9
8
8
  - 7
9
- version: 0.9.7
9
+ - 1
10
+ version: 0.9.7.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Ernie Miller
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-10-11 00:00:00 -04:00
18
+ date: 2010-10-12 00:00:00 -04:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency