Module: EffectiveLogging
- Defined in:
- lib/effective_logging.rb,
lib/effective_logging/engine.rb,
lib/effective_logging/version.rb,
lib/effective_logging/user_logger.rb,
lib/effective_logging/email_logger.rb,
lib/effective_logging/log_page_views.rb,
lib/effective_logging/log_changes_user.rb,
lib/effective_logging/active_record_logger.rb,
lib/generators/effective_logging/install_generator.rb
Defined Under Namespace
Modules: Generators, LogChangesUser, LogPageViews
Classes: ActiveRecordLogger, EmailLogger, Engine, UserLogger
Constant Summary
collapse
- VERSION =
'1.5.2'.freeze
Class Method Summary
collapse
Class Method Details
.authorized?(controller, action, resource) ⇒ Boolean
22
23
24
25
26
27
|
# File 'lib/effective_logging.rb', line 22
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
|
.log_changes_status ⇒ Object
41
42
43
|
# File 'lib/effective_logging.rb', line 41
def self.log_changes_status
'logged change'.freeze
end
|
.log_changes_user ⇒ Object
50
51
52
|
# File 'lib/effective_logging.rb', line 50
def self.log_changes_user
@log_changes_user
end
|
.log_changes_user=(user) ⇒ Object
This is set by the "set_log_changes_user" before_filter.
46
47
48
|
# File 'lib/effective_logging.rb', line 46
def self.log_changes_user=(user)
@log_changes_user = user
end
|
.setup {|_self| ... } ⇒ Object
18
19
20
|
# File 'lib/effective_logging.rb', line 18
def self.setup
yield self
end
|
.statuses ⇒ Object
37
38
39
|
# File 'lib/effective_logging.rb', line 37
def self.statuses
@statuses ||= (Array(@@additional_statuses).map { |status| status.to_s.downcase } | ['info', 'success', 'error'])
end
|
.supressed(&block) ⇒ Object
29
30
31
|
# File 'lib/effective_logging.rb', line 29
def self.supressed(&block)
@supressed = true; yield; @supressed = false
end
|
.supressed? ⇒ Boolean
33
34
35
|
# File 'lib/effective_logging.rb', line 33
def self.supressed?
@supressed == true
end
|