active_hash_relation 1.0.4 → 1.0.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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/active_hash_relation/sort_filters.rb +1 -1
- data/lib/active_hash_relation/version.rb +1 -1
- 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: fe8ba7c48a6ff435dd220d2b66c7b8945ddd1234
|
4
|
+
data.tar.gz: 81dc900c0146cc62cc9ec4fbc4f8828e7f8c7292
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31444ceef4793296c4cc128dd530a5a58653d7117c38fd78d38878c46dcd2e37fbe462c2c5a20add24a29fda19de6097e9e07702c3136c96c7ba137c31e09e1d
|
7
|
+
data.tar.gz: eec6a91578af20681ff700208b0da56b056ecab33020568b6091e4777194227839985b092b0839a8b1f311df6a8e8474c3707c2e5be6bdb30bc381fecb7de201
|
data/README.md
CHANGED
@@ -101,7 +101,7 @@ However I would strongly advice you to use a pagination gem like Kaminari, and u
|
|
101
101
|
|
102
102
|
### Sorting
|
103
103
|
You can apply sorting using the `property` and `order` attributes. For instance:
|
104
|
-
* `{property: 'created_at', order: 'desc'}`
|
104
|
+
* `{sort: {property: 'created_at', order: 'desc'}}`
|
105
105
|
|
106
106
|
If there is no column named after the property value, sorting is skipped.
|
107
107
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module ActiveHashRelation::SortFilters
|
2
2
|
def apply_sort(resource, params, model = nil)
|
3
|
-
if model.columns.map(&:name).include?(params[:property])
|
3
|
+
if model.columns.map(&:name).include?(params[:property].to_s)
|
4
4
|
resource = resource.order(params[:property] => (params[:order] || :desc) )
|
5
5
|
end
|
6
6
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_hash_relation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Filippos Vasilakis
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-11-
|
12
|
+
date: 2015-11-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|