You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to deploy my application I ran into a failure whenever I tried to precompile my assets for production, receiving an error:
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
rake aborted!
PG::UndefinedTable: ERROR: relation "part_models" does not exist
LINE 5: WHERE a.attrelid = '"part_models"'::regclass
^
: 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 = '"part_models"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
I was able to trace the offending code to my model which was calling:
"acts_as :part_model, :as => :partable"
After a bit of troubleshooting I discovered a workaround was to just check if the table exists:
if ActiveRecord::Base.connection.table_exists? 'part_models'
acts_as :part_model, :as => :partable
end
This works but feels a bit hacky.
The text was updated successfully, but these errors were encountered:
When trying to deploy my application I ran into a failure whenever I tried to precompile my assets for production, receiving an error:
I was able to trace the offending code to my model which was calling:
After a bit of troubleshooting I discovered a workaround was to just check if the table exists:
This works but feels a bit hacky.
The text was updated successfully, but these errors were encountered: