activesearch 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/activesearch.gemspec +2 -0
- data/lib/activesearch/base.rb +4 -4
- data/lib/activesearch/version.rb +1 -1
- metadata +17 -1
data/activesearch.gemspec
CHANGED
@@ -17,6 +17,8 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
+
gem.add_dependency "activesupport"
|
21
|
+
|
20
22
|
gem.add_development_dependency "rspec"
|
21
23
|
gem.add_development_dependency "rspec-mocks"
|
22
24
|
gem.add_development_dependency "bson_ext"
|
data/lib/activesearch/base.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
+
require "active_support/core_ext/class/attribute"
|
2
|
+
|
1
3
|
module ActiveSearch
|
2
4
|
module Base
|
3
5
|
def self.included(parent)
|
4
6
|
parent.extend ClassMethods
|
7
|
+
parent.class_attribute :search_parameters, instance_reader: false
|
5
8
|
end
|
6
9
|
|
7
10
|
def search_options
|
@@ -24,12 +27,9 @@ module ActiveSearch
|
|
24
27
|
def search_by(params, conditions = {})
|
25
28
|
after_save :reindex, conditions
|
26
29
|
after_destroy :deindex, conditions
|
27
|
-
|
30
|
+
self.search_parameters = params
|
28
31
|
end
|
29
32
|
|
30
|
-
def search_parameters
|
31
|
-
@search_parameters
|
32
|
-
end
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
data/lib/activesearch/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activesearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,6 +11,22 @@ bindir: bin
|
|
11
11
|
cert_chain: []
|
12
12
|
date: 2012-11-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activesupport
|
16
|
+
requirement: !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: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
14
30
|
- !ruby/object:Gem::Dependency
|
15
31
|
name: rspec
|
16
32
|
requirement: !ruby/object:Gem::Requirement
|