active_reporter 0.7.1 → 0.7.3
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/active_reporter/dimension/enum.rb +17 -1
- data/lib/active_reporter/version.rb +1 -1
- data/spec/dummy/config/environments/development.rb +3 -3
- data/spec/dummy/config/environments/production.rb +3 -3
- data/spec/dummy/config/initializers/assets.rb +1 -1
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/test.log +96940 -0
- data/spec/dummy/tmp/local_secret.txt +1 -0
- data/spec/spec_helper.rb +0 -2
- metadata +7 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd621943a7508651f94f389d81cb897e5dc7eae2d10f9dd2f261f29533bdc588
|
4
|
+
data.tar.gz: da5082a988b18ff4f821f4e96c184f0e0bfae72bcc0474de2b6d110481bd428b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 561cc794d2820d10b6f62abb3a0da32f86a0dad34e007c6e5dede83ef30f5d6433cea1d308e44561a24fa3a30360859ccd7b9efb87a47078d9afc541654f40ef
|
7
|
+
data.tar.gz: d64d12a3fc5df2f0af7505f49f1987b963a2d7ed3909128e5af5cc7b42acf9c8e9c0d084924d9ae7cbe4c6941eafabf79730d054fe3722190d7c190bcc7e309e
|
@@ -13,6 +13,22 @@ module ActiveReporter
|
|
13
13
|
enum_values.keys.tap { |values| values.unshift(nil) unless values.include?(nil) }.uniq
|
14
14
|
end
|
15
15
|
|
16
|
+
def filter(relation)
|
17
|
+
values = if Rails.gem_version >= Gem::Version.new("7")
|
18
|
+
filter_values.map { |value| enum_values[value] }.uniq
|
19
|
+
else
|
20
|
+
filter_values
|
21
|
+
end
|
22
|
+
query = case values
|
23
|
+
when [] then "1=0"
|
24
|
+
when [nil] then "#{expression} IS NULL"
|
25
|
+
else
|
26
|
+
in_values = "#{expression} IN (?)"
|
27
|
+
values.include?(nil) ? "#{expression} IS NULL OR #{in_values}" : in_values
|
28
|
+
end
|
29
|
+
relation.where(query, values.compact)
|
30
|
+
end
|
31
|
+
|
16
32
|
private
|
17
33
|
|
18
34
|
def enum_values
|
@@ -31,7 +47,7 @@ module ActiveReporter
|
|
31
47
|
end
|
32
48
|
|
33
49
|
def enum?
|
34
|
-
|
50
|
+
Hash(model&.defined_enums).include?(attribute.to_s)
|
35
51
|
end
|
36
52
|
end
|
37
53
|
end
|
@@ -25,16 +25,16 @@ Rails.application.configure do
|
|
25
25
|
# Debug mode disables concatenation and preprocessing of assets.
|
26
26
|
# This option may cause significant delays in view rendering with a large
|
27
27
|
# number of complex assets.
|
28
|
-
config.assets.debug = true
|
28
|
+
# config.assets.debug = true
|
29
29
|
|
30
30
|
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
31
31
|
# yet still be able to expire them through the digest params.
|
32
|
-
config.assets.digest = true
|
32
|
+
# config.assets.digest = true
|
33
33
|
|
34
34
|
# Adds additional error checking when serving assets at runtime.
|
35
35
|
# Checks for improperly declared sprockets dependencies.
|
36
36
|
# Raises helpful error messages.
|
37
|
-
config.assets.raise_runtime_errors = true
|
37
|
+
# config.assets.raise_runtime_errors = true
|
38
38
|
|
39
39
|
# Raises error for missing translations
|
40
40
|
# config.action_view.raise_on_missing_translations = true
|
@@ -25,15 +25,15 @@ Rails.application.configure do
|
|
25
25
|
config.serve_static_files = ENV["RAILS_SERVE_STATIC_FILES"].present?
|
26
26
|
|
27
27
|
# Compress JavaScripts and CSS.
|
28
|
-
config.assets.js_compressor = :uglifier
|
28
|
+
# config.assets.js_compressor = :uglifier
|
29
29
|
# config.assets.css_compressor = :sass
|
30
30
|
|
31
31
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
32
|
-
config.assets.compile = false
|
32
|
+
# config.assets.compile = false
|
33
33
|
|
34
34
|
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
35
35
|
# yet still be able to expire them through the digest params.
|
36
|
-
config.assets.digest = true
|
36
|
+
# config.assets.digest = true
|
37
37
|
|
38
38
|
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
39
39
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
3
|
# Version of your assets, change this if you want to expire all your assets.
|
4
|
-
Rails.application.config.assets.version = "1.0"
|
4
|
+
# Rails.application.config.assets.version = "1.0"
|
5
5
|
|
6
6
|
# Add additional assets to the asset load path
|
7
7
|
# Rails.application.config.assets.paths << Emoji.images_path
|
File without changes
|