espresso 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/espresso.gemspec +2 -2
- data/lib/espresso/model.rb +7 -2
- data/lib/espresso/objects_controller.rb +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/espresso.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{espresso}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alexander Semyonov"]
|
12
|
-
s.date = %q{2009-
|
12
|
+
s.date = %q{2009-10-05}
|
13
13
|
s.description = %q{Useful templates for controller and model functions}
|
14
14
|
s.email = %q{rotuka@tokak.ru}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/espresso/model.rb
CHANGED
@@ -3,9 +3,13 @@ require 'searchlogic'
|
|
3
3
|
module Espresso
|
4
4
|
# @author Alexander Semyonov
|
5
5
|
module Model
|
6
|
+
unloadable
|
7
|
+
|
6
8
|
def self.included(model)
|
7
|
-
model.
|
8
|
-
|
9
|
+
model.class_eval do
|
10
|
+
extend ClassMethods
|
11
|
+
include InstanceMethods
|
12
|
+
end
|
9
13
|
end
|
10
14
|
|
11
15
|
module ClassMethods
|
@@ -24,6 +28,7 @@ module Espresso
|
|
24
28
|
@results = @search.paginate(:page => page)
|
25
29
|
[@search, @results]
|
26
30
|
end
|
31
|
+
alias_method :search_results, :paginate_found
|
27
32
|
|
28
33
|
# Make searchlogic query from simple query option
|
29
34
|
# Needed to be reimplemented in subclasses
|
@@ -28,7 +28,7 @@ module Espresso
|
|
28
28
|
# @return [WillPaginate::Collection] collection of objects
|
29
29
|
def collection
|
30
30
|
unless (result = get_collection_ivar).present?
|
31
|
-
@search, result = end_of_association_chain.
|
31
|
+
@search, result = end_of_association_chain.search_results(params[:page], params[:query], params[:q])
|
32
32
|
set_collection_ivar(result)
|
33
33
|
end
|
34
34
|
result
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: espresso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Semyonov
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-10-05 00:00:00 +04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|