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

undefined method `include?' for nil:NilClass #44

Closed
natesire opened this issue Feb 22, 2016 · 7 comments
Closed

undefined method `include?' for nil:NilClass #44

natesire opened this issue Feb 22, 2016 · 7 comments

Comments

@natesire
Copy link

The save method on the object is raising this error.

@natesire
Copy link
Author

Also. My test says sqlite is trying to save record. The dynamoid isn't over riding the orm behavior.

class Lead
include Dynamoid::Document

table :name => :leads, :key => :email, :read_capacity => 400, :write_capacity => 400

field :question
field :email
field :created, :datetime, {default: ->(){Time.now}}

validates_presence_of :lead
validates_format_of :email, :with => /@/
end

@adamthedeveloper
Copy link

This is happening when you have no tables to start with. See the changes in my fork: adamthedeveloper. Instead of assuming there are always tables, I set the tables variable to an empty array if it's nil so that the include? still works.

@natesire
Copy link
Author

Ah ok. Will check it out.

@adamthedeveloper
Copy link

adamthedeveloper@19cf5df

@philipmw
Copy link
Member

@adamthedeveloper how about a patch?

@adamthedeveloper
Copy link

Here you go: #63

@pboling
Copy link
Member

pboling commented Jun 22, 2017

This is fixed by #109

@pboling pboling closed this as completed Jun 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants