Giter Site home page Giter Site logo

config about responders HOT 4 CLOSED

heartcombo avatar heartcombo commented on May 27, 2024
config

from responders.

Comments (4)

marcandre avatar marcandre commented on May 27, 2024

Actually, ||= would do since the default is false, no need to check for nil especially.

from responders.

josevalim avatar josevalim commented on May 27, 2024

If you change this value after Rails is initialized, then they won't propagate. I am not really a fan of depending on Rails.application.config.responders, but here is what we could do:

  1. Move the configuration options to Responders, so we would have Responders.namespace_lookup
  2. Make Rails.application.config.responders = Responders

If you want to change that, a patch is welcome. :) Thanks a lot for your contributions!

from responders.

nashby avatar nashby commented on May 27, 2024

@josevalim is it still make sense? If so could you explain a bit how it'll help with current issue? :) Not sure I understood it right.

from responders.

carlosantoniodasilva avatar carlosantoniodasilva commented on May 27, 2024

@nashby by doing Rails.application.config.responders = Responders, we'll be able to use Rails.application.config.responders.namespace_lookup = true in an initializer as @marcandre expects, because the end result would be the same as setting Responders.namespace_lookup = true.

Right now we use an initializer hook to do that, which means the configuration will be already propagated at the time Rails requires config/initializers, so setting the config there won't work.

@josevalim it's just going to be a bit weird to use Responders.namespace_lookup instead of Responders::FlashResponder.namespace_lookup since the configs are only related to the flash one. A quick way of doing less changes is setting config.responders to the FlashResponder, since it's the only one that actually have configs :D. But, I think we can live with that anyway.

from responders.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.