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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b6475c5d16eab20007e41f124b9db329cc9788a
4
- data.tar.gz: 256afb180075bb73703f59bd5496aa4af6225f0b
3
+ metadata.gz: fe8ba7c48a6ff435dd220d2b66c7b8945ddd1234
4
+ data.tar.gz: 81dc900c0146cc62cc9ec4fbc4f8828e7f8c7292
5
5
  SHA512:
6
- metadata.gz: 6edc4a82cbd60e9f459d6490d09086ec7f224f9bc346555972b848bb6b4a2417e181a9b136c21699bbe48d90ac7608f201d9f2e6bb7a31be5836fd03a477aec2
7
- data.tar.gz: f9ed814d95540090b83f7aa744583ffd655884784587442f0fe691f2866503197c2da359f638130e129e9448c1a3948594284121749411f73f91543103926d8b
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
 
@@ -1,3 +1,3 @@
1
1
  module ActiveHashRelation
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
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
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-02 00:00:00.000000000 Z
12
+ date: 2015-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler