Skip to content

Instantly share code, notes, and snippets.

@der-flo
Created September 3, 2010 07:24
Show Gist options
  • Save der-flo/563547 to your computer and use it in GitHub Desktop.
Save der-flo/563547 to your computer and use it in GitHub Desktop.
class Foo < ActiveRecord::Base
default_value_for :store, {}
def entry_1= value
store[:entry_1] = value
end
end
Foo.new :entry_1 => 'bar'
# =>
# NoMethodError: You have a nil object when you didn't expect it!
# You might have expected an instance of Array.
# The error occurred while evaluating nil.[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment