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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1bf6843a2ae4e4c00bab4322ebc70f3401705cf
4
- data.tar.gz: ff599e8e50ce71d6b447b8297431a8cff607d416
3
+ metadata.gz: 7deae52edfacaa4d0297b096ed9de8b6d9fc1ec6
4
+ data.tar.gz: bc0be3ec0b612ba8f6987b109c5cd84a60126d4b
5
5
  SHA512:
6
- metadata.gz: fbbbb8138c30f727894d50b775b755ee50a10207c1c86086edad62d3229d2058cc803676cc312044bdb946c9396248f15f736e5bc51cc10a77ca809045a2550c
7
- data.tar.gz: dcc02c0dd11982eb6a640ce8bb57a4058539bde40f6da939ebdc690af3e792bd4bbe6368f72b22417ab25dac86c92641a5d6bf5f169cac541760bedcf1d62523
6
+ metadata.gz: ed177d4ada37619b4ac8b347a25372a7f4bbe59aa2980cdcfd51397982b3728ac1227b7585eba77a8ef0e290be0d46d7fcb4384ed9243ee0cf07e66a22a7b582
7
+ data.tar.gz: d8cd865b7a68503c7b070cd9213bc35ae1c6b28d1f1d68a31bd8c36618795226d22c8571012203a3e9d204ffca7ecba2dea53f2d1542c00574a35c1972df29c3
data/README.md CHANGED
@@ -1,29 +1,9 @@
1
1
  # TheSimpleSort
2
2
 
3
- TODO: Write a gem description
3
+ Simple sort for The!ProfitCMS
4
4
 
5
- ## Installation
5
+ ```ruby
6
+ include TheSimpleSort::Base
6
7
 
7
- Add this line to your application's Gemfile:
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
+ ```
@@ -1,3 +1,3 @@
1
1
  module TheSimpleSort
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -7,10 +7,10 @@ module TheSimpleSort
7
7
  extend ActiveSupport::Concern
8
8
 
9
9
  included do
10
- scope :recent, ->(field = nil) { order("#{ field || :id } DESC") }
11
- scope :old, ->(field = nil) { order("#{ field || :id } ASC") }
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 = :created_at){
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.1
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-06-22 00:00:00.000000000 Z
11
+ date: 2014-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler