Module: Vanity::Rails

Defined in:
lib/vanity/frameworks/rails.rb

Defined Under Namespace

Modules: AddParticipant, Dashboard, Filters, Helpers, Identity, TrackingImage, UseVanity, UseVanityMailer

Class Method Summary collapse

Class Method Details

.load!Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/vanity/frameworks/rails.rb', line 3

def self.load!
  ::Rails.configuration.before_initialize do
    Vanity.configuration.logger ||= ::Rails.logger
    Vanity.configuration.setup_locales
  end

  # Do this at the very end of initialization, allowing you to change
  # connection adapter, turn collection on/off, etc.
  ::Rails.configuration.after_initialize do
    Vanity.load! if Vanity.connection.connected?
  end
end