OSDN Git Service

import all source code
[pettanr/pettanr.git] / app / controllers / application_controller.rb
1 class ApplicationController < ActionController::Base
2   protect_from_forgery
3   before_filter :bf
4   
5   def bf
6     if Admin.count.to_i == 0
7       if params[:controller] == 'system' and params[:action] == 'start'
8       else
9         redirect_to :controller => '/system', :action => 'start'
10       end
11     else
12       if author_signed_in?
13         @artist = if current_author.artist?
14           current_author.artist
15         else
16           Artist.new author_id: current_author.id, email: current_author.email, name: current_author.name
17         end
18       end
19     end
20   end
21   
22 end