searchgasm 0.9.7 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.9.8. Fixed order_by helper bug when determing the text with arrays. Should use the first value instead of last. Added in per_page config option.
2
+
1
3
  v0.9.7. Complete class restructure, much more organized, added in documentation, added in helpers for using searchgasm in a rails app, updated readme with link to documentation as well as a live example, some bug fixes, more tests
2
4
 
3
5
  v0.9.6. Fix bug when instantiating with nil options
data/README.rdoc CHANGED
@@ -11,7 +11,8 @@ I'm a big fan of understanding what I'm using, so here's a quick explanation: Th
11
11
  == Quicklinks
12
12
 
13
13
  * <b>Documentation:</b> http://searchgasm.rubyforge.org
14
- * <b>Live rails example:</b> http://searchgasm_example.binarylogic.com
14
+ * <b>Easy pagination, ordering, and searching tutorial:</b> http://www.binarylogic.com/2008/9/7/tutorial-pagination-ordering-and-searching-with-searchgasm
15
+ * <b>The tutorial above, live:</b> http://searchgasm_example.binarylogic.com
15
16
 
16
17
  == Install and use
17
18
 
@@ -326,9 +327,9 @@ http://binarylogic.lighthouseapp.com/projects/16601-searchgasm
326
327
 
327
328
  == Credits
328
329
 
329
- Author: [Ben Johnson](http://github.com/binarylogic) of [Binary Logic](http://www.binarylogic.com)
330
+ Author: {Ben Johnson}[http://github.com/binarylogic] of {Binary Logic}[http://www.binarylogic.com]
330
331
 
331
- Credit to [Zack Ham](http://github.com/zackham) and [Robert Malko](http://github.com/malkomalko/) for helping with feature suggestions.
332
+ Credit to {Zack Ham}[http://github.com/zackham] and {Robert Malko}[http://github.com/malkomalko/] for helping with feature suggestions.
332
333
 
333
334
 
334
- Copyright (c) 2008 [Ben Johnson](http://github.com/binarylogic) of [Binary Logic](http://www.binarylogic.com), released under the MIT license
335
+ Copyright (c) 2008 {Ben Johnson}[http://github.com/binarylogic] of {Binary Logic}[http://www.binarylogic.com], released under the MIT license
@@ -55,6 +55,18 @@ module Searchgasm
55
55
  @pages_type = value.to_sym
56
56
  end
57
57
 
58
+ def per_page # :nodoc:
59
+ @per_page
60
+ end
61
+
62
+ # The default for per page.
63
+ #
64
+ # * <tt>Default:</tt> nil, nil means "show all"
65
+ # * <tt>Accepts:</tt> Any value in your per_page choices
66
+ def per_page=(value)
67
+ @per_page = value
68
+ end
69
+
58
70
  def per_page_choices # :nodoc:
59
71
  @per_page_choices ||= [10, 25, 50, 100, 150, 200, nil]
60
72
  end
@@ -164,7 +164,7 @@ module Searchgasm
164
164
  when String, Symbol
165
165
  relationship_name.blank? ? column_name.titleize : "#{relationship_name.titleize} #{column_name.titleize}"
166
166
  when Array
167
- determine_order_by_text(column_name.last)
167
+ determine_order_by_text(column_name.first)
168
168
  when Hash
169
169
  k = column_name.keys.first
170
170
  v = column_name.values.first
@@ -49,6 +49,10 @@ module Searchgasm #:nodoc:
49
49
  "#<#{klass} #{options_as_nice_string}>"
50
50
  end
51
51
 
52
+ def limit
53
+ @limit ||= Config.per_page
54
+ end
55
+
52
56
  def limit=(value)
53
57
  @limit = value.blank? || value == 0 ? nil : value.to_i
54
58
  end
@@ -67,7 +67,7 @@ module Searchgasm
67
67
 
68
68
  MAJOR = 0
69
69
  MINOR = 9
70
- TINY = 7
70
+ TINY = 8
71
71
 
72
72
  # The current version as a Version instance
73
73
  CURRENT = new(MAJOR, MINOR, TINY)
data/searchgasm.gemspec CHANGED
@@ -1,18 +1,18 @@
1
1
 
2
- # Gem::Specification for Searchgasm-0.9.7
2
+ # Gem::Specification for Searchgasm-0.9.8
3
3
  # Originally generated by Echoe
4
4
 
5
5
  --- !ruby/object:Gem::Specification
6
6
  name: searchgasm
7
7
  version: !ruby/object:Gem::Version
8
- version: 0.9.7
8
+ version: 0.9.8
9
9
  platform: ruby
10
10
  authors:
11
11
  - Ben Johnson of Binary Logic
12
12
  autorequire:
13
13
  bindir: bin
14
14
 
15
- date: 2008-09-06 00:00:00 -04:00
15
+ date: 2008-09-07 00:00:00 -04:00
16
16
  default_executable:
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchgasm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.7
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Johnson of Binary Logic
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-06 00:00:00 -04:00
12
+ date: 2008-09-07 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency