Sha256: b41c25962cefccb3f10a140240151377feee4c1459ec38fb0c90bc07672f444d

Contents?: true

Size: 923 Bytes

Versions: 9

Compression:

Stored size: 923 Bytes

Contents

require "satis/version"
require "satis/engine"
require "satis/configuration"
require "satis/active_record_helpers"

Browser::Base.include(Browser::Aliases)

module Satis
  extend Configurable

  Deprecation = ActiveSupport::Deprecation.new("2.2", "Satis")

  class << self
    def confirm_before_leave?
      return false if config.nil?

      config.confirm_before_leave
    end

    def submit_on_enter?
      return true if config.nil?

      config.submit_on_enter
    end

    def add_helper(name, component)
      Satis::Helpers::Container.add_helper(name, component)
    end

    def add_component_helper(component_name, name, component)
      klass = "Satis::#{component_name.to_s.classify}::Component".safe_constantize
      return if klass.blank?
      klass.add_helper name, component
    end
  end

  # Include helpers
  ActiveSupport.on_load(:active_record) do
    include Satis::ActiveRecordHelpers
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
satis-2.1.48 lib/satis.rb
satis-2.1.47 lib/satis.rb
satis-2.1.46 lib/satis.rb
satis-2.1.45 lib/satis.rb
satis-2.1.44 lib/satis.rb
satis-2.1.43 lib/satis.rb
satis-2.1.42 lib/satis.rb
satis-2.1.41 lib/satis.rb
satis-2.1.40 lib/satis.rb