rails_db 1.3 → 1.3.1
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/Gemfile +1 -1
- data/Gemfile.lock +3 -3
- data/app/controllers/rails_db/tables_controller.rb +6 -1
- data/lib/ext/ransack_ext.rb +26 -0
- data/lib/rails_db.rb +2 -1
- data/lib/rails_db/version.rb +1 -1
- data/test/dummy/db/rails_db.sqlite3 +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30c03fb955b0d8932f2dbd935bab422dfe0644f6
|
4
|
+
data.tar.gz: 853129177a8045c693cbea03308b12ba161accf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 687909d318a7eee756e0b9030db9df7fb9f0e7476d43eec8c8d7af2af8fbab43ddc7885e75a527c3d033a1017514b2179ab01a39fb6adf5ace96befa0783f385
|
7
|
+
data.tar.gz: d0129ed74fe4eb16174f0eeb496917f1a50c00b846c7163eb1b0f6bc7ce6b24d746748aa9c96212f0c419c74e13728040a17acb529a53b2df129aebe57ff34f7
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rails_db (1.
|
4
|
+
rails_db (1.3.1)
|
5
5
|
codemirror-rails
|
6
6
|
jquery-rails
|
7
7
|
kaminari
|
@@ -71,7 +71,7 @@ GEM
|
|
71
71
|
railties (>= 4.2.0)
|
72
72
|
thor (>= 0.14, < 2.0)
|
73
73
|
json (1.8.3)
|
74
|
-
kaminari (0.
|
74
|
+
kaminari (0.17.0)
|
75
75
|
actionpack (>= 3.0.0)
|
76
76
|
activesupport (>= 3.0.0)
|
77
77
|
launchy (2.4.3)
|
@@ -151,7 +151,7 @@ DEPENDENCIES
|
|
151
151
|
axlsx_rails
|
152
152
|
codemirror-rails
|
153
153
|
jquery-rails
|
154
|
-
kaminari
|
154
|
+
kaminari (>= 0.17.0)
|
155
155
|
launchy
|
156
156
|
mime-types (< 3.0)
|
157
157
|
mysql2 (<= 0.3.20)
|
@@ -84,7 +84,12 @@ module RailsDb
|
|
84
84
|
private
|
85
85
|
|
86
86
|
def build_search
|
87
|
-
|
87
|
+
if Rails::VERSION::MAJOR >= 5
|
88
|
+
search_params = params.dup.permit!.to_h.with_indifferent_access
|
89
|
+
else
|
90
|
+
search_params = params
|
91
|
+
end
|
92
|
+
@q = model.ransack(search_params[:q])
|
88
93
|
@sql = @q.result.page(params[:page]).per(per_page).to_sql
|
89
94
|
@records = @q.result.page(params[:page]).per(per_page)
|
90
95
|
@q.build_condition if @q.conditions.empty?
|
@@ -0,0 +1,26 @@
|
|
1
|
+
if Rails::VERSION::MAJOR >= 5
|
2
|
+
|
3
|
+
module Ransack
|
4
|
+
module Helpers
|
5
|
+
module FormHelper
|
6
|
+
|
7
|
+
class SortLink
|
8
|
+
|
9
|
+
def url_options_with_feature
|
10
|
+
result = url_options_without_feature
|
11
|
+
if result.respond_to?(:permit!)
|
12
|
+
result.permit!
|
13
|
+
else
|
14
|
+
result
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
alias_method :url_options_without_feature, :url_options
|
19
|
+
alias_method :url_options, :url_options_with_feature
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
data/lib/rails_db.rb
CHANGED
data/lib/rails_db/version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Kasyanchuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -322,6 +322,7 @@ files:
|
|
322
322
|
- config/initializers/will_paginate_fix.rb
|
323
323
|
- config/locales/simple_form.en.yml
|
324
324
|
- config/routes.rb
|
325
|
+
- lib/ext/ransack_ext.rb
|
325
326
|
- lib/ext/simple_form_ext.rb
|
326
327
|
- lib/ext/string_ext.rb
|
327
328
|
- lib/generators/USAGE
|