mincer 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mincer/action_view/sort_helper.rb +2 -2
- data/lib/mincer/base.rb +6 -1
- data/lib/mincer/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: 4fe4e5745ecaebed714a0197f0f75dd980ff2bd2
|
4
|
+
data.tar.gz: d29860ee8eacbb82ec760d5b294a0eea6be9f21b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f25396af84ca1800d70dd7350290eb14e17f37dbe67c71857042cb78ec8203e853174db7d04c4141b8749d609cfa305df15d18524d3954c2cfed6aafd87e3dfa
|
7
|
+
data.tar.gz: 0b6cea105256eb0a726a3455972b806e40b03f8718b7985c6da7e2cc60cba75f78c206ef9972a2926f92bb8ac3db1fd54d75daa56a1b9ff3489d60c196ad93c3
|
@@ -5,8 +5,8 @@ module Mincer
|
|
5
5
|
#
|
6
6
|
# <tt>collection</tt> - instance of QueryObject
|
7
7
|
# <tt>attribute</tt> - Attribute that will be used to sort table
|
8
|
-
def sort_url_for(collection, attribute)
|
9
|
-
url_for(
|
8
|
+
def sort_url_for(collection, attribute, permitted_params = params)
|
9
|
+
url_for(permitted_params.merge(:sort => attribute, :order => opposite_order_for(collection, attribute)))
|
10
10
|
end
|
11
11
|
|
12
12
|
def opposite_order_for(collection, attribute)
|
data/lib/mincer/base.rb
CHANGED
@@ -7,7 +7,12 @@ module Mincer
|
|
7
7
|
|
8
8
|
# Builds query object
|
9
9
|
def initialize(scope, args = {})
|
10
|
-
@
|
10
|
+
@args = if defined?(ActionController::Parameters) && args.is_a?(ActionController::Parameters)
|
11
|
+
args.to_unsafe_h
|
12
|
+
else
|
13
|
+
::ActiveSupport::HashWithIndifferentAccess.new(args)
|
14
|
+
end
|
15
|
+
@scope, @relation = scope, build_query(scope, @args)
|
11
16
|
execute_processors
|
12
17
|
end
|
13
18
|
|
data/lib/mincer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mincer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Krasinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|