I could be wrong but my guess is that you are making calls on
item.widget_locations[:left_area1] = thing
If so, you should change that to
item.left_area1 = thing
because you told the
store_accessor to create attributes
:left_area1, :mid_area1, :left_area2, :mid_area2, :right_area2 that will be serialized to database column
:widget_locations. Now these attributes will behave like normal attributes, so you can put validations on them etc.
This also allows you to update an item as usual:
item.update(name: 'Test', left_area: 'garden', mid_area: 'livingroom')
The catch with a
hstore is that accessing the serialized column will allow you to add new unknown attributes, so it is best to directly access the attributes you explicitly specified.