Sha256: 322a9f7cceb75a56ce91883d2fac1221248c58712914c020a259cf456e36e851

Contents?: true

Size: 552 Bytes

Versions: 44

Compression:

Stored size: 552 Bytes

Contents

module Generators
  module Avo
    module Concerns
      module OverrideController
        extend ActiveSupport::Concern

        def override_controller?
          return false unless controller_name.in? controllers_list

          say("Avo uses #{controller_class} internally, overriding it would cause malfunctions.", :red)
          true
        end

        def controllers_list
          Dir[::Avo::Engine.root.join("app", "controllers", "avo", "*.rb")].map { |file_path| File.basename(file_path, ".rb") }
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
avo-3.14.3 lib/generators/avo/concerns/override_controller.rb
avo-3.14.2 lib/generators/avo/concerns/override_controller.rb
avo-3.14.1 lib/generators/avo/concerns/override_controller.rb
avo-3.14.0 lib/generators/avo/concerns/override_controller.rb
avo-3.13.7 lib/generators/avo/concerns/override_controller.rb
avo-3.13.6 lib/generators/avo/concerns/override_controller.rb
avo-3.13.5 lib/generators/avo/concerns/override_controller.rb
avo-3.13.4 lib/generators/avo/concerns/override_controller.rb
avo-3.13.3 lib/generators/avo/concerns/override_controller.rb
avo-3.13.2 lib/generators/avo/concerns/override_controller.rb
avo-3.13.1 lib/generators/avo/concerns/override_controller.rb
avo-3.13.0 lib/generators/avo/concerns/override_controller.rb
avo-3.12.0 lib/generators/avo/concerns/override_controller.rb
avo-3.11.10 lib/generators/avo/concerns/override_controller.rb
avo-3.11.9 lib/generators/avo/concerns/override_controller.rb
avo-3.11.8 lib/generators/avo/concerns/override_controller.rb
avo-3.11.7 lib/generators/avo/concerns/override_controller.rb
avo-3.11.6 lib/generators/avo/concerns/override_controller.rb
avo-3.11.5 lib/generators/avo/concerns/override_controller.rb
avo-3.11.4 lib/generators/avo/concerns/override_controller.rb