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

:attributes as field name fails spectacularly #33

Closed
Peeja opened this issue Jan 20, 2011 · 3 comments
Closed

:attributes as field name fails spectacularly #33

Peeja opened this issue Jan 20, 2011 · 3 comments

Comments

@Peeja
Copy link

Peeja commented Jan 20, 2011

Adding field :attributes causes an immediate SystemStackError: stack level too deep with one (useless) level of backtrace. (When running Cucumber it's somewhere in Cucumber; when running RSpec it's somewhere in RSpec.)

Probably the right thing to do is to raise a better error sooner, so the user knows what the real problem is.

@zilkey
Copy link
Collaborator

zilkey commented Jan 23, 2011

I can't reproduce this. Can you post more details (active_hash version, ruby version, exact code snippet etc...)? The following does not error out for me with AcitveHash 0.9.1 on REE:

class SomeClass < ActiveHash::Base
  fields :attributes
end

class SomeClass < ActiveHash::Base
  field :attributes
end

It's still confusing and wrong and I'll fix it, but I'd like to be able to reproduce the issue if possible. Thanks!

@zilkey
Copy link
Collaborator

zilkey commented Jan 23, 2011

For now I've updated ActiveHash to raise an error when trying to overwrite :attributes. Eventually I'll probably move that into the Rails module, since it's only really there for AR compatibility (POLS).

@Peeja
Copy link
Author

Peeja commented Jan 23, 2011

Sounds good. I'll try to reproduce it in a clean app.

This issue was closed.
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

2 participants