Module: ActsAsApprovable

Defined in:
lib/acts_as_approvable.rb,
lib/acts_as_approvable/error.rb,
lib/acts_as_approvable/model.rb,
lib/acts_as_approvable/version.rb,
lib/acts_as_approvable/railtie.rb,
lib/acts_as_approvable/ownership.rb,
lib/generators/acts_as_approvable/base.rb,
lib/acts_as_approvable/model/class_methods.rb,
lib/acts_as_approvable/model/instance_methods.rb,
lib/acts_as_approvable/model/create_instance_methods.rb,
lib/acts_as_approvable/model/update_instance_methods.rb

Defined Under Namespace

Modules: Generators, Model, Ownership Classes: Error, Railtie

Constant Summary

VERSION =
File.read(File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'VERSION'))).chomp

Class Method Summary (collapse)

Class Method Details

+ (Object) disable

Disable the approval queue at a global level.



28
29
30
# File 'lib/acts_as_approvable.rb', line 28

def self.disable
  @enabled = false
end

+ (Object) enable

Enable the approval queue at a global level.



22
23
24
# File 'lib/acts_as_approvable.rb', line 22

def self.enable
  @enabled = true
end

+ (Boolean) enabled?

Returns true if the approval queue is enabled globally.

Returns:

  • (Boolean)


34
35
36
37
# File 'lib/acts_as_approvable.rb', line 34

def self.enabled?
  @enabled = true if @enabled.nil?
  @enabled
end

+ (Object) owner_class

Get the referenced Owner class to be used by generic finders.

See Also:



51
52
53
# File 'lib/acts_as_approvable.rb', line 51

def self.owner_class
  @owner_class
end

+ (Object) owner_class=(klass)

Set the referenced Owner class to be used by generic finders.

See Also:



43
44
45
# File 'lib/acts_as_approvable.rb', line 43

def self.owner_class=(klass)
  @owner_class = klass
end

+ (Object) owner_source

Get the class used for overriding Ownership retrieval

See Also:



67
68
69
# File 'lib/acts_as_approvable.rb', line 67

def self.owner_source
  @owner_source
end

+ (Object) owner_source=(source)

Set the class used for overriding Ownership retrieval

See Also:



59
60
61
# File 'lib/acts_as_approvable.rb', line 59

def self.owner_source=(source)
  @owner_source = source
end

+ (Object) view_language

Get the engine used for rendering view files. Defaults to 'erb'



79
80
81
82
83
84
85
# File 'lib/acts_as_approvable.rb', line 79

def self.view_language
  if Rails.version =~ /^3\./
    Rails.configuration.generators.rails[:template_engine].try(:to_s) || 'erb'
  else
    @lang || 'erb'
  end
end

+ (Object) view_language=(lang)

Set the engine used for rendering view files.



73
74
75
# File 'lib/acts_as_approvable.rb', line 73

def self.view_language=(lang)
  @lang = lang
end