timo3377/simple_eav — Issue #13: hash keys as strings cannot retrieve respective value
Author: bnisbett
Created: 2011-10-17 14:11:36+00:00
State: open

One other thing i discovered was that if a user inputs the custom attributes with the key as a string then simple_eav does not retrieve the value for that key.
For example:

@post = Post.create("intro" => "I am an intro")

@post.intro #NoMethodError: undefined method `intro' for #

The fix i did was to make all keys symbols when they are saved. So I changed this line in the assign_attributes() method.

simple_eav_attrs[column] = value
to

simple_eav_attrs[column.to_sym] = value

Not sure if this is the approach you would take but this is just my suggestion.
This however is not an issue if submitting the custom attributes through a form since rails saves the serialized attributes as a HashWithIndifferentAccess.