byroot / activerecord-typedstore

ActiveRecord::Store but with type definition
MIT License
439 stars 57 forks source link

Fix typo on return value #9

Closed arthurnn closed 10 years ago

arthurnn commented 10 years ago

seems like there was a typo on this. Without this, shopify tests fail with:

Error:
test_#foo
NoMethodError: undefined method `cast' for nil:NilClass
    /home/ubuntu/shopify/vendor/bundle/ruby/2.1.0/bundler/gems/activerecord-typedstore-66448f4c2bcc/lib/active_record/typed_store/typed_hash.rb:52:in `cast_value'
byroot commented 10 years ago

Damn ! Can you add a test in spec/active_record/typed_store/typed_hash.rb:

e.g.

  context 'unknown columns' do

    it 'can be assigned' do
      hash = hash_class.new
      hash[:unknown_key] = 42
      expect(hash[:unknown_key]).to be == 42
    end

  end
arthurnn commented 10 years ago

regression test added.

byroot commented 10 years ago

Perfect ! Thanks !