Testing store_attribute database save behavior
$ bin/bundle install
$ bin/rails db:setup
$ bin/rails db:migrate
$ bin/rails c
$ (rails console) Shop.create!
$ (rails console) ActiveRecord::Base.connection.execute('select * from shops order by created_at desc limit 1').to_a
Notice how the defaults are present in the insert sql query itself.
User written attributes always overwrite defaults
Even though values are empty in database, when query at ActiveRecord level still returns the defaults. This is the expected behavior. This is because of the configuration at ApplicationRecord