postgresql - Hstore array attribute won't update in code, but works in console -
this works in rails console:
pry(main)> calendar.update({"open_times"=>[{"start"=>"1111-11-11t00:30:00.000z", "end"=>"1111-11-11t04:00:00.000z", "title"=>" "}]}) (0.3ms) savepoint active_record_1 (0.2ms) release savepoint active_record_1 => true
but same update method doesn't work anywhere else (model, controller, etc.). error returned typeerror: can't cast array to
. doesn't can't cast array (though assume hstore).
here's migration column:
def change enable_extension 'hstore' add_column :calendars, :open_times, :hstore, array: true, default: [], null: false end
thoughts?
restarted servers (rails/postgres), tried again. worked.
Comments
Post a Comment