slash_admin 1.0.4 → 1.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f5bde9d4de6fa2c39197e090dee5bc7c4cca1bba1081dd3ddb6242af111b253
4
- data.tar.gz: 8b1ef63565ec37d1381df9d0cb51649238414e5e8a249e0bf99fd5ffd11bb319
3
+ metadata.gz: cf1f27f49b9b55f98ce8af943d5c3c9c0a682810da3f9439339215fcbe74f1d0
4
+ data.tar.gz: 7a81000b24701b380fb4c9cdcccb8d74635ac8b5af99e6fe06b5cc8edba64d46
5
5
  SHA512:
6
- metadata.gz: c93495b0258ecd29303cfc99fc19e66f90cfdedda691c5cd318da5abe4f400954d955eb4c75f8e95fa0c81ade83022e07e8c53da119bb067b13807ab77c166d6
7
- data.tar.gz: 23cb10977a3093ca81ab46ca6e7e376d336c93e90471eaf78a8ef922a49f660db26efb89fec1845443dd33317621f4a7bc766e15215f349cc2daad5a3e508b64
6
+ metadata.gz: 648584d064c58d2ba54c656c249ff10f4f4c486e3fd075d69e1c3d022e7a34a1671a4ae21623fffbc9e5e78db021d4a65fd474110ce267c261c2554846e1c6b4
7
+ data.tar.gz: 7ab8584258a1d35fb28c6283cc11d04015c3373a5e107ddef223d615f2e0f683452f25580b2d259cfd8acfa2374c433fd8a828346c041c55bd41d1db53d88c8c
@@ -22,8 +22,7 @@ module SlashAdmin
22
22
  column = @model_class.arel_table[params[:order_field].to_sym]
23
23
  order = params[:order].downcase
24
24
  if %w[asc desc].include?(order)
25
- attributes = @model_class.new.attributes.keys
26
- if (!attributes.include?(params[:order_field]) && @model_class.method_defined?(params[:order_field])) || @models_export.is_a?(Array)
25
+ if @models_export.is_a?(Array)
27
26
  @models = if order == "asc"
28
27
  @models_export.sort { |m1, m2| m1.send(params[:order_field]) <=> m2.send(params[:order_field]) }
29
28
  else
@@ -233,6 +232,7 @@ module SlashAdmin
233
232
  if @model_class.respond_to?(:translated_attribute_names) && @model_class.translated_attribute_names.include?(attr.to_sym)
234
233
  attr = "#{@model_class.name.singularize.underscore}_translations.#{attr}"
235
234
  end
235
+ # aggregate_reflections ?
236
236
  attr_prefixed = model.table_name + "." + attr
237
237
  case attr_type
238
238
  # TODO : Should be rewritten
@@ -1,3 +1,3 @@
1
1
  module SlashAdmin
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slash_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - KOVACS Nicolas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-06 00:00:00.000000000 Z
11
+ date: 2019-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails