{"action":"created","issue":{"url":"https://api.github.com/repos/byroot/activerecord-typedstore/issues/33","labels_url":"https://api.github.com/repos/byroot/activerecord-typedstore/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/byroot/activerecord-typedstore/issues/33/comments","events_url":"https://api.github.com/repos/byroot/activerecord-typedstore/issues/33/events","html_url":"https://github.com/byroot/activerecord-typedstore/issues/33","id":108172739,"number":33,"title":"undefined method 'accessor' for ActiveRecord::Type::Value","user":{"login":"Antiarchitect","id":50209,"avatar_url":"https://avatars.githubusercontent.com/u/50209?v=3","gravatar_id":"","url":"https://api.github.com/users/Antiarchitect","html_url":"https://github.com/Antiarchitect","followers_url":"https://api.github.com/users/Antiarchitect/followers","following_url":"https://api.github.com/users/Antiarchitect/following{/other_user}","gists_url":"https://api.github.com/users/Antiarchitect/gists{/gist_id}","starred_url":"https://api.github.com/users/Antiarchitect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Antiarchitect/subscriptions","organizations_url":"https://api.github.com/users/Antiarchitect/orgs","repos_url":"https://api.github.com/users/Antiarchitect/repos","events_url":"https://api.github.com/users/Antiarchitect/events{/privacy}","received_events_url":"https://api.github.com/users/Antiarchitect/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-24T17:07:06Z","updated_at":"2015-09-24T19:11:41Z","closed_at":"2015-09-24T18:44:52Z","body":"Rails 4.2.4, activerecord-typedstore 0.6.1. When I try to instanciate record with decimal typed value described. I get this:\r\n\r\n    NoMethodError: undefined method `accessor' for #<ActiveRecord::Type::Value:0x0000000a097270>\r\n        from /home/andrey/.rvm/gems/ruby-2.2.3@medm/gems/activerecord-4.2.4/lib/active_record/store.rb:132:in `store_accessor_for'\r\n        from /home/andrey/.rvm/gems/ruby-2.2.3@medm/gems/activerecord-4.2.4/lib/active_record/store.rb:121:in `read_store_attribute'\r\n        from /home/andrey/PROJECTS/activerecord-typedstore/lib/active_record/typed_store/extension.rb:118:in `write_store_attribute'\r\n"},"comment":{"url":"https://api.github.com/repos/byroot/activerecord-typedstore/issues/comments/143022391","html_url":"https://github.com/byroot/activerecord-typedstore/issues/33#issuecomment-143022391","issue_url":"https://api.github.com/repos/byroot/activerecord-typedstore/issues/33","id":143022391,"user":{"login":"byroot","id":44640,"avatar_url":"https://avatars.githubusercontent.com/u/44640?v=3","gravatar_id":"","url":"https://api.github.com/users/byroot","html_url":"https://github.com/byroot","followers_url":"https://api.github.com/users/byroot/followers","following_url":"https://api.github.com/users/byroot/following{/other_user}","gists_url":"https://api.github.com/users/byroot/gists{/gist_id}","starred_url":"https://api.github.com/users/byroot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/byroot/subscriptions","organizations_url":"https://api.github.com/users/byroot/orgs","repos_url":"https://api.github.com/users/byroot/repos","events_url":"https://api.github.com/users/byroot/events{/privacy}","received_events_url":"https://api.github.com/users/byroot/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T19:11:41Z","updated_at":"2015-09-24T19:11:41Z","body":"Oh! I see. You can't define a store on something that isn't a real attribute. TypedStore need to read the column information from ActiveRecord.\r\n\r\nIf you really wish to delegate this column, you can still do it this way:\r\n\r\n```ruby\r\nbegin\r\n  require 'bundler/inline'\r\nrescue LoadError => e\r\n  $stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'\r\n  raise e\r\nend\r\n\r\ngemfile(true) do\r\n  source 'https://rubygems.org'\r\n  # Activate the gem you are reporting the issue against.\r\n  gem 'activerecord', '4.2.4'\r\n  gem 'sqlite3'\r\n  gem 'byebug'\r\n  gem 'activerecord-typedstore', '0.6.1'\r\nend\r\n\r\nrequire 'active_record'\r\nrequire 'minitest/autorun'\r\nrequire 'logger'\r\n\r\n# Ensure backward compatibility with Minitest 4\r\nMinitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)\r\n\r\n# This connection will do for database-independent bug reports.\r\nActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')\r\nActiveRecord::Base.logger = Logger.new(STDOUT)\r\n\r\nActiveRecord::Schema.define do\r\n  create_table :posts, force: true do |t|\r\n    t.integer :author_id\r\n    t.text :data\r\n  end\r\n  create_table :authors, force: true do |t|\r\n  end\r\nend\r\n\r\nclass Post < ActiveRecord::Base\r\n  belongs_to :author\r\n\r\n  typed_store :data do |s|\r\n    s.decimal :value\r\n  end\r\nend\r\n\r\nclass Author < ActiveRecord::Base\r\n  has_one :post\r\n\r\n  delegate :value, :value=, to: :bound_post\r\n\r\n  def bound_post\r\n    @bound_post ||= build_post\r\n  end\r\nend\r\n\r\nclass BugTest < Minitest::Test\r\n  def test_association_stuff\r\n    Author.create!(value: 36.6)\r\n\r\n    assert_equal 1, Author.count\r\n  end\r\nend\r\n```"}}