lib/keycard/railtie.rb in keycard-0.2.0 vs lib/keycard/railtie.rb in keycard-0.2.1
- old
+ new
@@ -73,34 +73,34 @@
else
raise "Keycard::DB.config must be configured"
end
end
- Railtie.before_blocks.each do |block|
+ self.class.before_blocks.each do |block|
block.call(config.to_h)
end
end
# This runs after everything in 'config/initializers' runs.
initializer "keycard.after_initializers", after: :load_config_initializers do
config = Keycard::DB.config
- Railtie.after_blocks.each do |block|
+ self.class.after_blocks.each do |block|
block.call(config.to_h)
end
- Keycard::DB.initialize! unless Railtie.under_rake?
+ Keycard::DB.initialize! unless self.class.under_rake?
- Railtie.ready_blocks.each do |block|
+ self.class.ready_blocks.each do |block|
block.call(Keycard::DB.db)
end
end
def rake_files
base = Pathname(__dir__) + '../tasks/'
[base + 'migrate.rake']
end
rake_tasks do
- Railtie.under_rake!
+ self.class.under_rake!
rake_files.each { |file| load file }
end
end