Fixed db:all rake task

This commit is contained in:
Priit Tark 2015-03-20 12:26:18 +02:00
parent d8828750d9
commit cb3b2e39fc
2 changed files with 29 additions and 29 deletions

View file

@ -1,5 +1,10 @@
# otherwise rake not working 100%
con = ActiveRecord::Base.connection
begin
con = ActiveRecord::Base.connection
rescue ActiveRecord::NoDatabaseError
# for running rake tasks, no output
end
if con.present? && con.table_exists?('settings')
Setting.disclosure_name = true if Setting.disclosure_name.nil?
Setting.disclosure_name = true if Setting.disclosure_name.nil?