sort_out 0.1 → 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/README.markdown +33 -0
- data/lib/sort_out.rb +2 -0
- data/lib/sort_out/helpers.rb +1 -0
- data/lib/sort_out/version.rb +1 -1
- metadata +4 -13
data/README.markdown
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
sort_out
|
2
|
+
==============
|
3
|
+
|
4
|
+
sort_out provides automatic and configurable order for ActiveRecord.
|
5
|
+
|
6
|
+
Installation
|
7
|
+
------------
|
8
|
+
|
9
|
+
You can use sort_out as a gem in Rails 3.
|
10
|
+
|
11
|
+
To use the gem version, put the following gem requirement in your `Gemfile`:
|
12
|
+
|
13
|
+
gem "sort_out"
|
14
|
+
|
15
|
+
|
16
|
+
Usage
|
17
|
+
-----
|
18
|
+
|
19
|
+
To use sort_out you need to configure in your model:
|
20
|
+
|
21
|
+
sortable :default_column => 'deadline', :after => [[:deadline, :desc]],
|
22
|
+
:by => [ :deadline, :code, [:customer, 'people.name'] ]
|
23
|
+
|
24
|
+
* default_column: the column that will be used when there is nothing explicited. (default: name)
|
25
|
+
* after: is the second order that will de done (Example: "... order by name, done_at desc") (default: [])
|
26
|
+
* by: is the fields that you want to allow the user to order (default: nil)
|
27
|
+
|
28
|
+
### Compatibility
|
29
|
+
|
30
|
+
* Rails 3.0.4 in Ruby 1.8.7 and Ruby 1.9.2
|
31
|
+
|
32
|
+
### License
|
33
|
+
MIT License. Copyright 2011 29sul Tecnologia da Informação <http://www.29sul.com.br/>
|
data/lib/sort_out.rb
CHANGED
data/lib/sort_out/helpers.rb
CHANGED
data/lib/sort_out/version.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sort_out
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 9
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
version: "0.1"
|
5
|
+
version: 0.1.1
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Felipe Diesel
|
@@ -14,7 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-
|
13
|
+
date: 2011-04-01 00:00:00 -03:00
|
18
14
|
default_executable:
|
19
15
|
dependencies: []
|
20
16
|
|
@@ -30,6 +26,7 @@ extra_rdoc_files: []
|
|
30
26
|
files:
|
31
27
|
- .gitignore
|
32
28
|
- Gemfile
|
29
|
+
- README.markdown
|
33
30
|
- Rakefile
|
34
31
|
- lib/sort_out.rb
|
35
32
|
- lib/sort_out/active_record.rb
|
@@ -50,23 +47,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
50
47
|
requirements:
|
51
48
|
- - ">="
|
52
49
|
- !ruby/object:Gem::Version
|
53
|
-
hash: 3
|
54
|
-
segments:
|
55
|
-
- 0
|
56
50
|
version: "0"
|
57
51
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
52
|
none: false
|
59
53
|
requirements:
|
60
54
|
- - ">="
|
61
55
|
- !ruby/object:Gem::Version
|
62
|
-
hash: 3
|
63
|
-
segments:
|
64
|
-
- 0
|
65
56
|
version: "0"
|
66
57
|
requirements: []
|
67
58
|
|
68
59
|
rubyforge_project: sort_out
|
69
|
-
rubygems_version: 1.
|
60
|
+
rubygems_version: 1.6.2
|
70
61
|
signing_key:
|
71
62
|
specification_version: 3
|
72
63
|
summary: ActiveRecord extension that makes easy to order fields.
|