acts_as_ordinalized 0.1.4 → 0.1.5
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/README.rdoc +35 -2
- data/VERSION +1 -1
- data/acts_as_ordinalized.gemspec +2 -2
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -2,7 +2,40 @@
|
|
2
2
|
|
3
3
|
This is a simple acts_as gem providing the active record models with ordinal numbers. The ordinals numbering is per query, but should work nicely with will paginate showing correct ordinal numbers on paginated results.
|
4
4
|
|
5
|
-
|
5
|
+
=== Example
|
6
|
+
|
7
|
+
* works with normal querries
|
8
|
+
|
9
|
+
class Ordinalized < ActiveRecord::Base
|
10
|
+
acts_as_ordinalized
|
11
|
+
end
|
12
|
+
ordinalized_collection = Ordinalized.all
|
13
|
+
ordinalized_collection.first.ordinal_number
|
14
|
+
=> 1
|
15
|
+
ordinalized_collection[1].ordinal_number
|
16
|
+
=> 2
|
17
|
+
|
18
|
+
* works with will_paginate
|
19
|
+
|
20
|
+
paginated_collection = Ordinalized.paginate(:page => 2, :per_page => 10)
|
21
|
+
paginated_collection.first.ordinal_number
|
22
|
+
=> 11
|
23
|
+
|
24
|
+
* works with sphinx
|
25
|
+
|
26
|
+
class OrdinalizedWithSphinx < ActiveRecord::Base
|
27
|
+
define_index do
|
28
|
+
...
|
29
|
+
end
|
30
|
+
# must be declared after indexes (the wrapped method must be defined before acts_as_ordinalized is used)
|
31
|
+
acts_as_ordinalized :wrapped_methods => :search
|
32
|
+
end
|
33
|
+
|
34
|
+
sphinx_collection = OrdinalizedWithSphinx.search
|
35
|
+
ordinalized_collection.first.ordinal_number
|
36
|
+
=> 1
|
37
|
+
|
38
|
+
=== Note on Patches/Pull Requests
|
6
39
|
|
7
40
|
* Fork the project.
|
8
41
|
* Make your feature addition or bug fix.
|
@@ -12,6 +45,6 @@ This is a simple acts_as gem providing the active record models with ordinal num
|
|
12
45
|
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
46
|
* Send me a pull request. Bonus points for topic branches.
|
14
47
|
|
15
|
-
|
48
|
+
=== Copyright
|
16
49
|
|
17
50
|
Copyright (c) 2010 mandaryn. See LICENSE for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/acts_as_ordinalized.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{acts_as_ordinalized}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["mandaryn"]
|
12
|
-
s.date = %q{2010-08-
|
12
|
+
s.date = %q{2010-08-18}
|
13
13
|
s.description = %q{This is a simple acts_as gem providing the active record models with ordinal numbers. The ordinals numbering is per query, but should work nicely with will paginate showing correct ordinal numbers on paginated results.}
|
14
14
|
s.email = %q{mandaryyyn@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_ordinalized
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- mandaryn
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-18 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|