In this example, AppConfig has been setup with the Postgres defaults and a column named api_key however, there are currently no rows in the configured database.
irb(main):004:0> AppConfig.api_key
=> nil
irb(main):006:0> AppConfig.api_key = 'foobar'
=> "foobar"
irb(main):007:0> AppConfig.save!
PG::Error: ERROR: syntax error at or near "WHERE"
LINE 1: UPDATE app_config SET WHERE id =
^
This is happening because the initial call to fetch_data! returns no results.
In this example, AppConfig has been setup with the Postgres defaults and a column named
api_key
however, there are currently no rows in the configured database.This is happening because the initial call to
fetch_data!
returns no results.