Closed ddeyoung closed 9 years ago
Hmm, looks like we could set that config variable as a proc to avoid this. Can you try this?
config.mailer_sender = Proc.new { Setting.get_with_default('mail.from', Rails.application.config.settings.mail.from) }
Fixed in 590b192dfaf870760ea9569a2fa284cfbd59cf7a
Confirmed that this solved the issue.
https://github.com/bborn/lewsnetter/blob/master/config/initializers/devise.rb#L13
The Devise initializer pulling from Setting fails because the smailer relation does not yet exist when running rake db:setup or any command used to initialize the database.
PG::UndefinedTable: ERROR: relation "smailer_properties" does not exist LINE 5: WHERE a.attrelid = '"smailer_properties"'::re... ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"smailer_properties"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum
/opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `async_exec': PG::UndefinedTable: ERROR: relation "smailer_properties" does not exist LINE 5: WHERE a.attrelid = '"smailer_properties"'::re... ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"smailer_properties"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum (ActiveRecord::StatementInvalid)