Module: EffectiveCpd
- Includes:
- EffectiveGem
- Defined in:
- lib/effective_cpd.rb,
lib/effective_cpd/engine.rb,
lib/effective_cpd/version.rb,
lib/generators/effective_cpd/install_generator.rb
Defined Under Namespace
Modules: Generators Classes: Engine
Constant Summary collapse
- VERSION =
'1.7.2'
Class Method Summary collapse
- .config_keys ⇒ Object
- .CpdAudit ⇒ Object
- .CpdAuditLevel ⇒ Object
- .CpdAuditReview ⇒ Object
- .CpdBulkAudit ⇒ Object
- .CpdCycle ⇒ Object
- .CpdStatement ⇒ Object
- .current_cpd_cycle(date: nil) ⇒ Object
- .mailer_class ⇒ Object
- .previous_cpd_cycle(date: nil) ⇒ Object
- .use_effective_messaging? ⇒ Boolean
Class Method Details
.config_keys ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/effective_cpd.rb', line 8 def self.config_keys [ :cpd_categories_table_name, :cpd_activities_table_name, :cpd_cycles_table_name, :cpd_rules_table_name, :cpd_special_rules_table_name, :cpd_special_rule_mates_table_name, :cpd_statements_table_name, :cpd_statement_activities_table_name, :cpd_audit_levels_table_name, :cpd_audit_level_sections_table_name, :cpd_audit_level_questions_table_name, :cpd_audit_level_question_options_table_name, :cpd_audits_table_name, :cpd_audit_responses_table_name, :cpd_audit_response_options_table_name, :cpd_audit_reviews_table_name, :cpd_audit_review_items_table_name, :cpd_bulk_audits_table_name, :cpd_targets_table_name, :layout, :auditee_user_scope, :audit_reviewer_user_scope, :use_effective_messaging, :mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin, :mailer_subject, :use_effective_email_templates, :cpd_statement_class_name, :cpd_audit_class_name, :cpd_audit_level_class_name, :cpd_audit_review_class_name, :cpd_bulk_audit_class_name ] end |
.CpdAudit ⇒ Object
40 41 42 |
# File 'lib/effective_cpd.rb', line 40 def self.CpdAudit cpd_audit_class_name&.constantize || Effective::CpdAudit end |
.CpdAuditLevel ⇒ Object
44 45 46 |
# File 'lib/effective_cpd.rb', line 44 def self.CpdAuditLevel cpd_audit_level_class_name&.constantize || Effective::CpdAuditLevel end |
.CpdAuditReview ⇒ Object
48 49 50 |
# File 'lib/effective_cpd.rb', line 48 def self.CpdAuditReview cpd_audit_review_class_name&.constantize || Effective::CpdAuditReview end |
.CpdBulkAudit ⇒ Object
52 53 54 |
# File 'lib/effective_cpd.rb', line 52 def self.CpdBulkAudit cpd_bulk_audit_class_name&.constantize || Effective::CpdBulkAudit end |
.CpdCycle ⇒ Object
36 37 38 |
# File 'lib/effective_cpd.rb', line 36 def self.CpdCycle Effective::CpdCycle end |
.CpdStatement ⇒ Object
32 33 34 |
# File 'lib/effective_cpd.rb', line 32 def self.CpdStatement cpd_statement_class_name&.constantize || Effective::CpdStatement end |
.current_cpd_cycle(date: nil) ⇒ Object
60 61 62 63 64 |
# File 'lib/effective_cpd.rb', line 60 def self.current_cpd_cycle(date: nil) date ||= Time.zone.now cpd_cycles = Effective::CpdCycle.all.reorder(start_at: :asc).all.where('start_at <= ?', date) cpd_cycles.to_a.last end |
.mailer_class ⇒ Object
28 29 30 |
# File 'lib/effective_cpd.rb', line 28 def self.mailer_class mailer&.constantize || Effective::CpdMailer end |
.previous_cpd_cycle(date: nil) ⇒ Object
66 67 68 69 70 |
# File 'lib/effective_cpd.rb', line 66 def self.previous_cpd_cycle(date: nil) date ||= Time.zone.now cpd_cycles = Effective::CpdCycle.all.reorder(start_at: :asc).all.where('start_at <= ?', date) cpd_cycles.to_a.last(2).first end |
.use_effective_messaging? ⇒ Boolean
56 57 58 |
# File 'lib/effective_cpd.rb', line 56 def self.use_effective_messaging? defined?(EffectiveMessaging) && !!use_effective_messaging end |