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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44608941dec0f1e6b18cdb81910de487b1499871
4
- data.tar.gz: 1e337b048d5294dfa78351d6d07f4fe2c1dd8096
3
+ metadata.gz: 4fe4e5745ecaebed714a0197f0f75dd980ff2bd2
4
+ data.tar.gz: d29860ee8eacbb82ec760d5b294a0eea6be9f21b
5
5
  SHA512:
6
- metadata.gz: c284ecc7351d0bbd9ff1a535c609e11c5ee1b45b28c6d1cb052eedeaad9d509955b1462127ea7c7b593e7e967dead3b281e30d831dcc0cf0edde844f48e80b2c
7
- data.tar.gz: 0838d96e0e56118f26173b190dbfef1fb2ac28cb712aab91b851e8e7b8657532afbbf58f8a990ec15602b992acf87d4c45f61dfc0c1761b66550e5be9a59f459
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(params.merge(:sort => attribute, :order => opposite_order_for(collection, attribute)))
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
- @scope, @args, @relation = scope, ::ActiveSupport::HashWithIndifferentAccess.new(args), build_query(scope, args)
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
 
@@ -1,7 +1,7 @@
1
1
  module Mincer
2
2
 
3
3
  def self.version
4
- Gem::Version.new '0.2.7'
4
+ Gem::Version.new '0.2.8'
5
5
  end
6
6
 
7
7
  module VERSION #:nodoc:
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.7
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-06 00:00:00.000000000 Z
11
+ date: 2016-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord