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

Introduce #default method to set application options #1551

Merged
merged 1 commit into from Jan 10, 2014

Conversation

Projects
None yet
2 participants
@ujifgc
Member

ujifgc commented Jan 10, 2014

Working on Padrino extensions with a lot of configuration options I ended up with calling tons of

        app.set :login_url, '/login'             unless app.respond_to?(:login_url)
        app.set :login_model, :account           unless app.respond_to?(:login_model)

Since we are claiming to be modular do you think it would be handy to have app.default method to be able to set these options if they are not already set?

@nesquena

This comment has been minimized.

Show comment
Hide comment
@nesquena

nesquena Jan 10, 2014

Member

FWIW, seems like a common pattern and a nice convenience method

Member

nesquena commented Jan 10, 2014

FWIW, seems like a common pattern and a nice convenience method

ujifgc added a commit that referenced this pull request Jan 10, 2014

Merge pull request #1551 from padrino/default-set
Introduce #default method to set application options

@ujifgc ujifgc merged commit 860d808 into master Jan 10, 2014

1 check passed

default The Travis CI build passed
Details

@ujifgc ujifgc deleted the default-set branch Jan 10, 2014

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