Sha256: 87569dfa07bd738a363cac4deb3843ecc78b7152447df40f9db83f2247399cdb

Contents?: true

Size: 985 Bytes

Versions: 1

Compression:

Stored size: 985 Bytes

Contents

module FatFreeCRM
  module Cloudfuji
    class Engine < Rails::Engine
      config.before_initialize do
        # Register observers to fire Cloudfuji events
        (config.active_record.observers ||= []) << :cloudfuji_lead_observer
      end
    
      config.to_prepare do
        require 'fat_free_crm/cloudfuji/view_hooks'

        # Add Event Rules tab
        begin
          unless FatFreeCRM::Tabs.admin.any? {|t| t[:text] == "Event Rules" }
            FatFreeCRM::Tabs.admin << {
              :text => "Event Rules",
              :url => { :controller => "admin/event_rules" }
            }
          end

          unless FatFreeCRM::Tabs.main.any? {|t| t[:text] == "Unknown Emails" }
            FatFreeCRM::Tabs.main << {
              :text => "Unknown Emails",
              :url => { :controller => "unknown_emails" }
            }
          end
        rescue TypeError
          puts "You must migrate your settings table."
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ffcrm_cloudfuji-0.4.1 lib/ffcrm_cloudfuji/engine.rb