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

pulibrary / allsearch_api / 75c99aff-f046-43e1-b1a5-6faf70549e46

18 Dec 2025 09:53PM UTC coverage: 99.867% (-0.07%) from 99.933%
75c99aff-f046-43e1-b1a5-6faf70549e46

push

circleci

web-flow
Merge pull request #537 from pulibrary/initialize-9

Stop using Rails initializers

14 of 15 new or added lines in 3 files covered. (93.33%)

1504 of 1506 relevant lines covered (99.87%)

74.08 hits per line

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

91.67
/init/load_flipper.rb
1
# frozen_string_literal: true
2

3
require allsearch_path 'init/rom_factory'
1✔
4

5
# Flipper must be required after a database connection is established
6
# However, we may be in a context where the database is not yet available
7
# (e.g. rake servers:start), so we don't throw an error if we can't setup
8
# the database or flipper
9

10
class LoadFlipper
1✔
11
  def initialize(rom_factory_class: RomFactory)
1✔
12
    @rom_factory_class = rom_factory_class
3✔
13
  end
14

15
  def call
1✔
16
    case rom_factory_class.new.database_if_available
3✔
17
    in Success
18
      begin
19
        require 'flipper-sequel'
2✔
20
      rescue Sequel::Error
NEW
21
        nil
×
22
      end
23
    in Failure
24
      nil
1✔
25
    end
26
  end
27

28
  private
1✔
29

30
  attr_reader :rom_factory_class
1✔
31
end
32

33
LoadFlipper.new.call
1✔
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