Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load fails on finding additional attributes #185

Open
hlms opened this issue Jan 22, 2015 · 0 comments
Open

load fails on finding additional attributes #185

hlms opened this issue Jan 22, 2015 · 0 comments

Comments

@hlms
Copy link

hlms commented Jan 22, 2015

This line: https://github.com/Veraticus/Dynamoid/blob/master/lib/dynamoid/fields.rb#L4 says:

All fields on a Dynamoid::Document must be explicitly defined -- if you have fields in the database that are not specified with field, then they will be ignored.

But when I had additional fields in DynamoDB, I got exception:

NoMethodError: undefined method `my_additional_field=' for #<MyTable:0xa6dddc8>

        from activemodel-3.2.19/lib/active_model/attribute_methods.rb:407:in `method_missing'
        from dynamoid-0.6.1.1/lib/dynamoid/document.rb:123:in `block in load'
        from dynamoid-0.6.1.1/lib/dynamoid/document.rb:123:in `each'
        from dynamoid-0.6.1.1/lib/dynamoid/document.rb:123:in `load'
        from dynamoid-0.6.1.1/lib/dynamoid/document.rb:118:in `block in initialize'
        from activesupport-3.2.19/lib/active_support/callbacks.rb:403:in `_run__356022796__initialize__809605463__callbacks'
        from activesupport-3.2.19/lib/active_support/callbacks.rb:405:in `__run_callback'
        from activesupport-3.2.19/lib/active_support/callbacks.rb:385:in `_run_initialize_callbacks'
        from activesupport-3.2.19/lib/active_support/callbacks.rb:81:in `run_callbacks'
        from dynamoid-0.6.1.1/lib/dynamoid/document.rb:111:in `initialize'
        from dynamoid-0.6.1.1/lib/dynamoid/persistence.rb:61:in `new'
        from dynamoid-0.6.1.1/lib/dynamoid/persistence.rb:61:in `from_database'
        from dynamoid-0.6.1.1/lib/dynamoid/identity_map.rb:19:in `from_database'
        from dynamoid-0.6.1.1/lib/dynamoid/dirty.rb:8:in `from_database'
        from dynamoid-0.6.1.1/lib/dynamoid/finders.rb:60:in `find_by_id'
        from dynamoid-0.6.1.1/lib/dynamoid/identity_map.rb:35:in `find_by_id'
        from dynamoid-0.6.1.1/lib/dynamoid/finders.rb:28:in `find'
        from dynamoid-0.6.1.1/lib/dynamoid/document.rb:154:in `reload'
        from (irb):5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant