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

has_settings apparently not working #8

Closed
klancaster opened this issue Aug 23, 2011 · 4 comments
Closed

has_settings apparently not working #8

klancaster opened this issue Aug 23, 2011 · 4 comments
Assignees

Comments

@klancaster
Copy link

I must be missing something. I added has_settings to a model, then in the console do

s = TheShop.last    # load the model
s.settings.color = :red 
s.settings.color # returns nil

When I check the log, the target_id and target_type are passed as NULL, so the values are stored as global rather than specific to the model.

@ghost ghost assigned ledermann Aug 24, 2011
@ledermann
Copy link
Owner

Strange, this should be working. Can you build a failing test case?

@klancaster
Copy link
Author

Ok - I am stumped. The tests pass, but it does not work in the console or in the app. I made the following change:

  ... || target_scoped.new(:var => var_name, :target_type => target_type, :target_id => target_id

and now it works, even though I think those values should be set. All your tests pass with this change, of course.

@ledermann
Copy link
Owner

Hm, the plugin works for me without any problems. Anyway, the plugin has some code smells, it should be reimplemented in a better way.

I have simplified the code a little bit (fcc1804), but I don't think this will fix your issue...

@klancaster
Copy link
Author

Ok. Well, its working for me now so I may just leave it alone. I'll let you know if I determine what is causing the issue. I'm on Linux running Rails 3.0.5 fwiw.

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