Module: Approval

Defined in:
lib/approval.rb,
lib/approval/config.rb,
lib/approval/engine.rb,
lib/approval/version.rb,
app/models/approval/item.rb,
app/models/approval/comment.rb,
app/models/approval/request.rb,
app/models/approval/execute_form.rb,
app/models/concerns/approval/mixins.rb,
app/models/approval/request_form/base.rb,
app/models/approval/respond_form/base.rb,
app/models/approval/application_record.rb,
app/models/approval/request_form/create.rb,
app/models/approval/request_form/update.rb,
app/models/approval/respond_form/cancel.rb,
app/models/approval/respond_form/reject.rb,
app/models/approval/request_form/destroy.rb,
app/models/approval/request_form/perform.rb,
app/models/approval/respond_form/approve.rb,
app/models/concerns/approval/acts_as_user.rb,
lib/generators/approval/install_generator.rb,
app/models/concerns/approval/form_notifiable.rb,
app/models/concerns/approval/acts_as_resource.rb,
app/models/approval/respond_form/approve_with_execute.rb

Defined Under Namespace

Modules: ActsAsResource, ActsAsUser, FormNotifiable, Mixins, RequestForm, RespondForm Classes: ApplicationRecord, Comment, Config, Engine, ExecuteForm, InstallGenerator, Item, Request

Constant Summary collapse

VERSION =
"0.7.1".freeze

Class Method Summary collapse

Class Method Details

.configObject


2
3
4
# File 'lib/approval.rb', line 2

def self.config
  @config ||= Config.new
end

.configure {|config| ... } ⇒ Object

Yields:


6
7
8
# File 'lib/approval.rb', line 6

def self.configure
  yield config
end

.init!Object


10
11
12
13
14
15
16
17
# File 'lib/approval.rb', line 10

def self.init!
  user_model = Approval.config.user_class_name.safe_constantize

  if user_model
    ::Approval::Request.define_user_association
    ::Approval::Comment.define_user_association
  end
end