Implement more informative error messages for attempts to set restricted columns #369

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

pvh commented Jul 7, 2011

Pretty straightforward. I considered adding a hint to call "unrestrict_primary_key", too, but I couldn't think of a way to phrase it without sounding encouraging.

Contributor

pvh commented Jul 7, 2011

How's that, then?

Sorry, I must have missed the notification about this earlier. I thought of a bigger issue with this approach. I checked and using respond_to? with a string internally creates a symbol, so it's not safe to use respond_to? with user input, as it can lead to denial of service through memory exhaustion. The only way around that is to get a list of methods, convert them to strings, and see if m is a member of the list. Also, for the primary key check, you need to deal with k being a string (it currently only works with symbols).

Owner

jeremyevans commented Jul 11, 2011

I've cherry picked this and fixed the symbol creation issue. I'll push tomorrow after running it through the full test suite.

Contributor

pvh commented Jul 11, 2011

Thanks!

On Sun, Jul 10, 2011 at 8:06 PM, jeremyevans <
reply@reply.github.com>wrote:

I've cherry picked this and fixed the symbol creation issue. I'll push
tomorrow after running it through the full test suite.

Reply to this email directly or view it on GitHub:
#369 (comment)

Peter van Hardenberg
San Francisco, California
"Everything was beautiful, and nothing hurt." -- Kurt Vonnegut

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment