Sha256: fb13821a14fe99a7cb2fae2e39f5b5547c7d66f0c410585a61012d763c179a40

Contents?: true

Size: 1020 Bytes

Versions: 4

Compression:

Stored size: 1020 Bytes

Contents

require 'haml-rails'
require 'simple_form'
require 'effective_orders'
require 'effective_qb_sync/engine'
require 'effective_qb_sync/version'

module EffectiveQbSync
  # The following are all valid config keys
  mattr_accessor :qb_requests_table_name
  mattr_accessor :qb_tickets_table_name
  mattr_accessor :qb_logs_table_name
  mattr_accessor :qb_order_items_table_name

  mattr_accessor :authorization_method

  mattr_accessor :quickbooks_username
  mattr_accessor :quickbooks_password
  mattr_accessor :quickbooks_tax_name

  mattr_accessor :error_email

  mattr_accessor :layout
  mattr_accessor :admin_simple_form_options

  def self.setup
    yield self
  end

  def self.authorized?(controller, action, resource)
    if authorization_method.respond_to?(:call) || authorization_method.kind_of?(Symbol)
      raise Effective::AccessDenied.new() unless (controller || self).instance_exec(controller, action, resource, &authorization_method)
    end
    true
  end

  def self.permitted_params
    [:note]
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
effective_qb_sync-1.1.3 lib/effective_qb_sync.rb
effective_qb_sync-1.1.2 lib/effective_qb_sync.rb
effective_qb_sync-1.1.1 lib/effective_qb_sync.rb
effective_qb_sync-1.1.0 lib/effective_qb_sync.rb