the_simple_sort 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/README.md +5 -25
- data/gem_version.rb +1 -1
- data/lib/the_simple_sort.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7deae52edfacaa4d0297b096ed9de8b6d9fc1ec6
|
4
|
+
data.tar.gz: bc0be3ec0b612ba8f6987b109c5cd84a60126d4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed177d4ada37619b4ac8b347a25372a7f4bbe59aa2980cdcfd51397982b3728ac1227b7585eba77a8ef0e290be0d46d7fcb4384ed9243ee0cf07e66a22a7b582
|
7
|
+
data.tar.gz: d8cd865b7a68503c7b070cd9213bc35ae1c6b28d1f1d68a31bd8c36618795226d22c8571012203a3e9d204ffca7ecba2dea53f2d1542c00574a35c1972df29c3
|
data/README.md
CHANGED
@@ -1,29 +1,9 @@
|
|
1
1
|
# TheSimpleSort
|
2
2
|
|
3
|
-
|
3
|
+
Simple sort for The!ProfitCMS
|
4
4
|
|
5
|
-
|
5
|
+
```ruby
|
6
|
+
include TheSimpleSort::Base
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
gem 'the_simple_sort'
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself as:
|
16
|
-
|
17
|
-
$ gem install the_simple_sort
|
18
|
-
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
TODO: Write usage instructions here
|
22
|
-
|
23
|
-
## Contributing
|
24
|
-
|
25
|
-
1. Fork it ( https://github.com/[my-github-username]/the_simple_sort/fork )
|
26
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
-
5. Create a new Pull Request
|
8
|
+
link_to 'Title↕', simple_sort_url(:title, params)
|
9
|
+
```
|
data/gem_version.rb
CHANGED
data/lib/the_simple_sort.rb
CHANGED
@@ -7,10 +7,10 @@ module TheSimpleSort
|
|
7
7
|
extend ActiveSupport::Concern
|
8
8
|
|
9
9
|
included do
|
10
|
-
scope :recent, ->(field =
|
11
|
-
scope :old, ->(field =
|
10
|
+
scope :recent, ->(field = :id) { reorder("#{ field } DESC") if field }
|
11
|
+
scope :old, ->(field = :id) { reorder("#{ field } ASC") if field }
|
12
12
|
|
13
|
-
scope :simple_sort, ->(params, default_sort_field =
|
13
|
+
scope :simple_sort, ->(params, default_sort_field = nil){
|
14
14
|
sort_column = params[:sort_column]
|
15
15
|
sort_type = params[:sort_type]
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: the_simple_sort
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya N. Zykin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|