sort_out 0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  require 'active_record'
2
4
 
3
5
  require 'sort_out/helpers'
@@ -1,3 +1,4 @@
1
+ # -*- coding: utf-8 -*-
1
2
  module SortOut
2
3
  module Helpers
3
4
  def sortable(column, title = nil, options = {})
@@ -1,3 +1,3 @@
1
1
  module SortOut
2
- VERSION = "0.1"
2
+ VERSION = "0.1.1"
3
3
  end
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
- segments:
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-03-14 00:00:00 -03:00
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.5.0
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.