This commit is contained in:
alterpub 2014-08-31 00:28:28 +04:00
parent 5485fe0e7f
commit 36097f6b8b
4 changed files with 13 additions and 3 deletions

View file

@ -9,6 +9,10 @@ module Admin
def new
@commercial = @conference.commercials.build
@commercial_types = (CONFIG['commercial_types'].nil? ? [nil] : CONFIG['commercial_types'].values)
if @commercial_types.first.nil?
flash[:alert] = "You have to include 'commercial_types' in config.yml, look at config.yml.example for example"
end
authorize! :create, @conference.commercials.new
end