rails/rails — pull request #16729 by Hermanverschooten (2014-08-28 10:44:24+00:00)
Title: add query (?) method to store_accessor

The accessor methods generated for store or store_accessor attributes
lack a ? method the normal active record attributes do have.
This add that method by verifying if the value is not nil?.

class TestModel < ActiveRecord::Base
store_accessor :data, :width, :height
end

test_model = TestModel.new(data: {width: 5})
test_model.width? #=> true
test_model.height? #=> false