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

Correct setting.find_or_default to do what it says #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snapai
Copy link

@snapai snapai commented Jul 26, 2013

The previous "setting ||= find_by_name(name)" line failed to load settings (only overwrote the setting if it did not contain a default - a condition guaranteed by the previous conditional to never occur)

"||=" is "set value if not already set" not "set value if right side isn't nil". There's probably a more graceful way to do this that doesn't involve pulling the setting -twice-, but I'm brand new to Ruby and have no idea how to do that. :)

The previous "setting ||= find_by_name(name)" line failed to load settings (only overwrote the setting if it did not contain a default - a condition guaranteed by the previous conditional to never occur)
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

Successfully merging this pull request may close these issues.

1 participant