Last active
December 14, 2015 22:28
-
-
Save wangjohn/5158062 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Define an application | |
class Application < Rails::Application | |
end | |
Application.new do | |
config.assets = "something" | |
# This doesn't work | |
initializers do | |
puts "Doing something here" | |
end | |
# This works correctly. | |
Rails::Application::initializers do | |
puts "Doing something there" | |
end | |
end | |
## Now initialize the application | |
module Rails | |
class Application | |
def initialize(&block) | |
# ... some stuff here ... | |
class_eval(&block) | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment