rails_admin_next 1.1.1 → 1.1.2
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/lib/rails_admin_next/adapters/active_record.rb +12 -1
- data/lib/rails_admin_next/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2bdbd212982bdb74e9a2288a5c14eba746b74b0a0ed902afbb0671cbdfd5c107
|
|
4
|
+
data.tar.gz: 119040f95b74f79a05571d9f099cb98668efa5921ee2a4b43668b3fb320302ec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 583c910d3d95569fb8031b30bfda1a71ae61ecc090bdd0e8289d9e0d4ea01ee7cf635e417c912d17a2a22c5d9f1bfe764d057391fb58744c21c1c22099130531
|
|
7
|
+
data.tar.gz: f7c7784f080f80977c21d9ae3bc02a822a1b2576aafe07f0dc063c4c7702180f425ea7905f00d8171e0a889a8842311cbff67ffd8268601eee68659b8bfdd032
|
|
@@ -182,7 +182,7 @@ module RailsAdminNext
|
|
|
182
182
|
|
|
183
183
|
def add(field, value, operator)
|
|
184
184
|
field.searchable_columns.flatten.each do |column_infos|
|
|
185
|
-
statement, value1, value2 = StatementBuilder.new(column_infos[:column], column_infos[:type], value, operator, @scope.connection.adapter_name).to_statement
|
|
185
|
+
statement, value1, value2 = StatementBuilder.new(quote(column_infos[:column]), column_infos[:type], value, operator, @scope.connection.adapter_name).to_statement
|
|
186
186
|
@statements << statement if statement.present?
|
|
187
187
|
@values << value1 unless value1.nil?
|
|
188
188
|
@values << value2 unless value2.nil?
|
|
@@ -191,6 +191,17 @@ module RailsAdminNext
|
|
|
191
191
|
end
|
|
192
192
|
end
|
|
193
193
|
|
|
194
|
+
# Columns arrive as bare "table.column", and a reserved-word name such as `order`
|
|
195
|
+
# is a syntax error unquoted. Anything else (raw SQL, already-quoted names) is
|
|
196
|
+
# passed through untouched.
|
|
197
|
+
def quote(column)
|
|
198
|
+
parts = column.split(".")
|
|
199
|
+
return column unless parts.size == 2 && parts.all?(/\A\w+\z/)
|
|
200
|
+
|
|
201
|
+
table, name = parts
|
|
202
|
+
"#{@scope.connection.quote_table_name(table)}.#{@scope.connection.quote_column_name(name)}"
|
|
203
|
+
end
|
|
204
|
+
|
|
194
205
|
def build
|
|
195
206
|
scope = @scope.where(@statements.join(" OR "), *@values)
|
|
196
207
|
scope = scope.references(*@tables.uniq) if @tables.any?
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails_admin_next
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel López Prat
|
|
@@ -340,7 +340,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
340
340
|
- !ruby/object:Gem::Version
|
|
341
341
|
version: 1.8.11
|
|
342
342
|
requirements: []
|
|
343
|
-
rubygems_version: 4.0.
|
|
343
|
+
rubygems_version: 4.0.20
|
|
344
344
|
specification_version: 4
|
|
345
345
|
summary: Admin for Rails
|
|
346
346
|
test_files: []
|