Module: Lokka::Before

Defined in:
lib/lokka/before.rb

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/lokka/before.rb', line 3

def self.registered(app)
  app.before do
    begin
      Site.first
    rescue DataObjects::SyntaxError
      Lokka::Database.new.create.setup
    end
  end

  app.before do
    @site = Site.first
    @title = @site.title
    @theme = Theme.new(settings.theme)
    @theme_types = []
    session[:locale] = params[:locale] if params[:locale]
  end

  app.before %r{(?!^/admin/login$)^/admin/.*$} do
    
  end

  app.before %r{(?!^/admin/login$)^/admin/.*$} do
    
  end
end