arql 0.2.4 → 0.2.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: bcf50149ad9ded8d667ea9afc40dea78d432525c8c62fe4f33d0d164e02acb81
4
- data.tar.gz: a6fd83949c0c87f1d4891fae1a8fb0fa65e13a48f9e8ddb327b02f499bdbc73a
3
+ metadata.gz: 032762276fe5d2c764f71eae665d16e2e4786368c7f154e7bd19be5188a49027
4
+ data.tar.gz: 73b8ceedbcd0abdc5c87c186374c8cfe0db50e0c22d1e645d2c10396ec8c4aa3
5
5
  SHA512:
6
- metadata.gz: 9f73ccc2e3669a6f10fa7555737d09fadec7e0c0457c5b8819dae65055aa6a045153cce2137ccf9a9742f509d9f5c8567fd617e9f3dda7e2136935cf3686a2f3
7
- data.tar.gz: ca3d6d547e8267066d72a6e67b09012b42b2e4defa36669c8b304707dc434cd6194a84a201c0fac8d3ed3f749ca017f2b4eaba6ce1f0a3813cfab34140827bc5
6
+ metadata.gz: cc70e4f11ff7bcfc4f0654d8a3e59ac2ae666e55237dff7d62e408c3c6bba200b22f3e064ea17dc513a94bbd4eacefa8f369d4d79c24d9a9ada857efa00c58af
7
+ data.tar.gz: 34491bfc5588a4bae89f26f889c5863e700f79b926902bb769c3e122082342706252fc41bcf461244bfc82e8f5a5e7dbf1eb4bd3c43d726f1d9fb9f5164170b0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arql (0.2.4)
4
+ arql (0.2.5)
5
5
  activerecord (~> 6.0.3)
6
6
  activesupport (~> 6.0.3)
7
7
  caxlsx (~> 3.0.2)
@@ -15,8 +15,10 @@ class Array
15
15
 
16
16
  def t(*attrs, **options)
17
17
  if (attrs.present? || options.present? && options[:except]) && present? && first.is_a?(ActiveRecord::Base)
18
+ column_names = first.attribute_names.map(&:to_sym)
19
+ attrs = attrs.flat_map { |e| e.is_a?(Regexp) ? column_names.grep(e) : e }.uniq
18
20
  if options.present? && options[:except]
19
- attrs = first.attribute_names.map(&:to_sym) if attrs.empty?
21
+ attrs = column_names if attrs.empty?
20
22
  if options[:except].is_a?(Regexp)
21
23
  attrs.reject! { |e| e =~ options[:except] }
22
24
  else
@@ -1,3 +1,3 @@
1
1
  module Arql
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang