meta_search 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in miraculous.gemspec
4
+ gemspec
data/Rakefile CHANGED
@@ -15,10 +15,10 @@ begin
15
15
  gem.homepage = "http://metautonomo.us/projects/metasearch/"
16
16
  gem.authors = ["Ernie Miller"]
17
17
  gem.add_development_dependency "shoulda"
18
- gem.add_dependency "activerecord", "~> 3.1.0"
19
- gem.add_dependency "activesupport", "~> 3.1.0"
18
+ gem.add_dependency "activerecord", "~> 3.1"
19
+ gem.add_dependency "activesupport", "~> 3.1"
20
20
  gem.add_dependency "polyamorous", "~> 0.5.0"
21
- gem.add_dependency "actionpack", "~> 3.1.0"
21
+ gem.add_dependency "actionpack", "~> 3.1"
22
22
  gem.post_install_message = <<END
23
23
 
24
24
  *** Thanks for installing MetaSearch! ***
@@ -63,7 +63,7 @@ end
63
63
 
64
64
  task :default => :test
65
65
 
66
- require 'rake/rdoctask'
66
+ require 'rdoc/task'
67
67
  Rake::RDocTask.new do |rdoc|
68
68
  version = File.exist?('VERSION') ? File.read('VERSION') : ""
69
69
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.1.2
@@ -27,7 +27,7 @@ module MetaSearch
27
27
  name = (args.size > 0 && !args.first.is_a?(Hash)) ? args.shift.to_s : builder.base.human_attribute_name(attr_name)
28
28
  prev_attr, prev_order = builder.search_attributes['meta_sort'].to_s.split('.')
29
29
 
30
- options = args.first.is_a?(Hash) ? args.shift : {}
30
+ options = args.first.is_a?(Hash) ? args.shift.dup : {}
31
31
  current_order = prev_attr == attr_name ? prev_order : nil
32
32
 
33
33
  if options[:default_order] == :desc
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "meta_search"
8
- s.version = "1.1.1"
8
+ s.version = "1.1.2"
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"]
@@ -67,23 +67,29 @@ Gem::Specification.new do |s|
67
67
 
68
68
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
69
69
  s.add_development_dependency(%q<shoulda>, [">= 0"])
70
- s.add_runtime_dependency(%q<activerecord>, ["~> 3.1.0"])
71
- s.add_runtime_dependency(%q<activesupport>, ["~> 3.1.0"])
70
+ s.add_development_dependency(%q<rake>, [">= 0"])
71
+ s.add_development_dependency(%q<sqlite3>, [">= 0"])
72
+ s.add_runtime_dependency(%q<activerecord>, ["~> 3.1"])
73
+ s.add_runtime_dependency(%q<activesupport>, ["~> 3.1"])
72
74
  s.add_runtime_dependency(%q<polyamorous>, ["~> 0.5.0"])
73
- s.add_runtime_dependency(%q<actionpack>, ["~> 3.1.0"])
75
+ s.add_runtime_dependency(%q<actionpack>, ["~> 3.1"])
74
76
  else
75
77
  s.add_dependency(%q<shoulda>, [">= 0"])
76
- s.add_dependency(%q<activerecord>, ["~> 3.1.0"])
77
- s.add_dependency(%q<activesupport>, ["~> 3.1.0"])
78
+ s.add_dependency(%q<rake>, [">= 0"])
79
+ s.add_dependency(%q<sqlite3>, [">= 0"])
80
+ s.add_dependency(%q<activerecord>, ["~> 3.1"])
81
+ s.add_dependency(%q<activesupport>, ["~> 3.1"])
78
82
  s.add_dependency(%q<polyamorous>, ["~> 0.5.0"])
79
- s.add_dependency(%q<actionpack>, ["~> 3.1.0"])
83
+ s.add_dependency(%q<actionpack>, ["~> 3.1"])
80
84
  end
81
85
  else
82
86
  s.add_dependency(%q<shoulda>, [">= 0"])
83
- s.add_dependency(%q<activerecord>, ["~> 3.1.0"])
84
- s.add_dependency(%q<activesupport>, ["~> 3.1.0"])
87
+ s.add_dependency(%q<rake>, [">= 0"])
88
+ s.add_dependency(%q<sqlite3>, [">= 0"])
89
+ s.add_dependency(%q<activerecord>, ["~> 3.1"])
90
+ s.add_dependency(%q<activesupport>, ["~> 3.1"])
85
91
  s.add_dependency(%q<polyamorous>, ["~> 0.5.0"])
86
- s.add_dependency(%q<actionpack>, ["~> 3.1.0"])
92
+ s.add_dependency(%q<actionpack>, ["~> 3.1"])
87
93
  end
88
94
  end
89
95
 
@@ -953,6 +953,12 @@ class TestSearch < Test::Unit::TestCase
953
953
  @s.all
954
954
  end
955
955
 
956
+ should "allow traversal of polymorphic associations" do
957
+ @s.notable_developer_type_company_name_starts_with = 'M'
958
+ assert_equal Company.find_by_name('Mission Data').developers.map(&:notes).flatten.sort {|a, b| a.id <=>b.id},
959
+ @s.all.sort {|a, b| a.id <=> b.id}
960
+ end
961
+
956
962
  should "raise an error when attempting to search against polymorphic belongs_to association without a type" do
957
963
  assert_raises ::MetaSearch::PolymorphicAssociationMissingTypeError do
958
964
  @s.notable_name_contains = 'MetaSearch'
@@ -432,4 +432,16 @@ class TestViewHelpers < ActionView::TestCase
432
432
  end
433
433
  end
434
434
  end
435
+
436
+ context "Any search" do
437
+ setup do
438
+ @s = Company.search(:name_contains => 'foo')
439
+ end
440
+
441
+ should "not modify passed-in parameters" do
442
+ params = { :controller => 'companies' }
443
+ sort_link(@s, :name, params)
444
+ assert_equal ({ :controller => 'companies' }), params
445
+ end
446
+ end
435
447
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meta_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,55 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-03 00:00:00.000000000Z
12
+ date: 2012-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: meta_search
16
+ requirement: &70158115443080 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70158115443080
25
+ - !ruby/object:Gem::Dependency
26
+ name: shoulda
27
+ requirement: &70158115442480 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70158115442480
36
+ - !ruby/object:Gem::Dependency
37
+ name: rake
38
+ requirement: &70158115441880 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70158115441880
47
+ - !ruby/object:Gem::Dependency
48
+ name: sqlite3
49
+ requirement: &70158115441300 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *70158115441300
14
58
  - !ruby/object:Gem::Dependency
15
59
  name: shoulda
16
- requirement: &70309382367880 !ruby/object:Gem::Requirement
60
+ requirement: &70158115440760 !ruby/object:Gem::Requirement
17
61
  none: false
18
62
  requirements:
19
63
  - - ! '>='
@@ -21,32 +65,32 @@ dependencies:
21
65
  version: '0'
22
66
  type: :development
23
67
  prerelease: false
24
- version_requirements: *70309382367880
68
+ version_requirements: *70158115440760
25
69
  - !ruby/object:Gem::Dependency
26
70
  name: activerecord
27
- requirement: &70309382364060 !ruby/object:Gem::Requirement
71
+ requirement: &70158115440160 !ruby/object:Gem::Requirement
28
72
  none: false
29
73
  requirements:
30
74
  - - ~>
31
75
  - !ruby/object:Gem::Version
32
- version: 3.1.0
76
+ version: '3.1'
33
77
  type: :runtime
34
78
  prerelease: false
35
- version_requirements: *70309382364060
79
+ version_requirements: *70158115440160
36
80
  - !ruby/object:Gem::Dependency
37
81
  name: activesupport
38
- requirement: &70309382359180 !ruby/object:Gem::Requirement
82
+ requirement: &70158115439620 !ruby/object:Gem::Requirement
39
83
  none: false
40
84
  requirements:
41
85
  - - ~>
42
86
  - !ruby/object:Gem::Version
43
- version: 3.1.0
87
+ version: '3.1'
44
88
  type: :runtime
45
89
  prerelease: false
46
- version_requirements: *70309382359180
90
+ version_requirements: *70158115439620
47
91
  - !ruby/object:Gem::Dependency
48
92
  name: polyamorous
49
- requirement: &70309382354200 !ruby/object:Gem::Requirement
93
+ requirement: &70158115292100 !ruby/object:Gem::Requirement
50
94
  none: false
51
95
  requirements:
52
96
  - - ~>
@@ -54,18 +98,18 @@ dependencies:
54
98
  version: 0.5.0
55
99
  type: :runtime
56
100
  prerelease: false
57
- version_requirements: *70309382354200
101
+ version_requirements: *70158115292100
58
102
  - !ruby/object:Gem::Dependency
59
103
  name: actionpack
60
- requirement: &70309382347400 !ruby/object:Gem::Requirement
104
+ requirement: &70158115291600 !ruby/object:Gem::Requirement
61
105
  none: false
62
106
  requirements:
63
107
  - - ~>
64
108
  - !ruby/object:Gem::Version
65
- version: 3.1.0
109
+ version: '3.1'
66
110
  type: :runtime
67
111
  prerelease: false
68
- version_requirements: *70309382347400
112
+ version_requirements: *70158115291600
69
113
  description: ! "\n Allows simple search forms to be created against an AR3 model\n
70
114
  \ and its associations, has useful view helpers for sort links\n and multiparameter
71
115
  fields as well.\n "
@@ -79,6 +123,7 @@ files:
79
123
  - .document
80
124
  - .gitmodules
81
125
  - CHANGELOG
126
+ - Gemfile
82
127
  - LICENSE
83
128
  - README.rdoc
84
129
  - Rakefile