rao-query 0.0.12.pre → 0.0.13.pre

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
- SHA1:
3
- metadata.gz: a05b2102255b0567b2c441bee22479ffd1908894
4
- data.tar.gz: c02dac7dffca8215de9c7c6782fa777508662495
2
+ SHA256:
3
+ metadata.gz: 3f003263ba9386ccfb87dfa59bb973ac14bba696543e9a37c39f4e5d012a0f2e
4
+ data.tar.gz: 73b0a754ccad61f19328566d3d3f4cd7897e16ed2e88ae9587fec8cf4f8da2cb
5
5
  SHA512:
6
- metadata.gz: 80865fce34a67ae0eb797ec4e8fe2d3ca78a2445f522c016b2a785b49d29b3096d17d2da24ac22493a3aca4758ccc68e43296456a3726b940d67ed602b87c8ba
7
- data.tar.gz: 3e2b93fa9d27ee330e532b000d27af59d13118ca4345a4006b835d7798d988577a1579675b830504c328c7c6ec42cfb9bbad426b710e3b2dc065649fbf9f8235
6
+ metadata.gz: 891abb214dc871471b8a7457fdd2655b0b468c85cd59376ee38a1dfa35dbbc5ad4e5a9e5fb5cad7d2b306f106ac4391978d248b5233bc39f5edcd1409f441d8f
7
+ data.tar.gz: c5e00bce7a067ff71dbb735f4437a37495a2aae2a64a9c1c13cefcbe7e1ec57b2d8ff08afba0bfd89d9b8e8be12965576dccc4cd5b3f0e2a21e001279f3630cc
@@ -51,10 +51,11 @@ module Rao
51
51
  end
52
52
 
53
53
  def default_query_params_exceptions
54
- %w(sort_by sort_direction utf8 commit page)
54
+ Rao::Query::Configuration.default_query_params_exceptions
55
55
  end
56
56
 
57
57
  def normalize_query_params(params)
58
+ return {} unless params['q'].respond_to?(:each_with_object)
58
59
  params['q'].each_with_object({}) { |(k, v), m| m[normalize_key(k)] = v }
59
60
  end
60
61
 
@@ -0,0 +1,15 @@
1
+ module Rao
2
+ module Query
3
+ module Generators
4
+ class InstallGenerator < Rails::Generators::Base
5
+ desc 'Generates the initializer'
6
+
7
+ source_root File.expand_path('../templates', __FILE__)
8
+
9
+ def generate_initializer
10
+ template 'initializer.rb', 'config/initializers/rao_query.rb'
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,7 @@
1
+ Rao::Query.configure do |config|
2
+ # Set the parameter names that will be ignored for building conditions.
3
+ #
4
+ # Default: config.default_query_params_exceptions = %w(sort_by sort_direction utf8 commit page locale)
5
+ #
6
+ config.default_query_params_exceptions = %w(sort_by sort_direction utf8 commit page locale)
7
+ end
@@ -4,6 +4,8 @@ module Rao
4
4
  def configure
5
5
  yield self
6
6
  end
7
+
8
+ mattr_accessor(:default_query_params_exceptions) { %w(sort_by sort_direction utf8 commit page locale) }
7
9
  end
8
10
  end
9
11
  end
data/lib/rao/query.rb CHANGED
@@ -8,4 +8,6 @@ module Rao
8
8
  module Query
9
9
  extend Configuration
10
10
  end
11
- end
11
+ end
12
+
13
+ Rao.configure { |c| c.register_configuration(:query, Rao::Query) }
data/lib/rao-query.rb CHANGED
@@ -1 +1,3 @@
1
+ require 'rao'
2
+
1
3
  require 'rao/query'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rao-query
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12.pre
4
+ version: 0.0.13.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-14 00:00:00.000000000 Z
11
+ date: 2019-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -139,6 +139,8 @@ files:
139
139
  - app/view_helpers/rao/query/application_helper.rb
140
140
  - config/locales/de.yml
141
141
  - config/locales/en.yml
142
+ - lib/generators/rao/query/install_generator.rb
143
+ - lib/generators/rao/query/templates/initializer.rb
142
144
  - lib/rao-query.rb
143
145
  - lib/rao/query.rb
144
146
  - lib/rao/query/configuration.rb
@@ -163,8 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
165
  - !ruby/object:Gem::Version
164
166
  version: 1.3.1
165
167
  requirements: []
166
- rubyforge_project:
167
- rubygems_version: 2.6.14
168
+ rubygems_version: 3.0.2
168
169
  signing_key:
169
170
  specification_version: 4
170
171
  summary: Simple Filter Queries for Ruby on Rails.