• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MushroomObserver / mushroom-observer / 12880700182

21 Jan 2025 05:27AM UTC coverage: 89.008% (-2.6%) from 91.587%
12880700182

push

github

nimmolo
Add more modules

9 of 885 new or added lines in 16 files covered. (1.02%)

1 existing line in 1 file now uncovered.

26941 of 30268 relevant lines covered (89.01%)

583.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

69.23
/app/classes/content_filter/string_filter.rb
1
# frozen_string_literal: true
2

3
class ContentFilter
1✔
4
  class StringFilter < ContentFilter
1✔
5
    def type
1✔
6
      [:string]
7,026✔
7
    end
8

9
    def on?(val)
1✔
10
      val.present?
332✔
11
    end
12

13
    def sql_conditions(query, model, vals)
1✔
14
      vals.map { |val| sql_condition(query, model, val) }.join(" OR ")
21✔
15
    end
16

17
    def scope_conditions(query, model, vals)
1✔
NEW
18
      return unless vals.length.positive?
×
19

20
      # Start without `or`, chain subsequent conditions
NEW
21
      conditions = sql_condition(query, model, vals.shift)
×
NEW
22
      vals.each do |val|
×
NEW
23
        conditions = conditions.or(sql_condition(query, model, val))
×
24
      end
25
    end
26
  end
27
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc