mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
Merge pull request #859 from internetee/remove-lib-from-autoload-path
Remove `lib` folder from autoload path
This commit is contained in:
commit
2828f8ca72
14 changed files with 57 additions and 58 deletions
|
@ -1,23 +0,0 @@
|
|||
# the following line is required for PaperTrail >= 4.0.0 with Rails
|
||||
PaperTrail::Rails::Engine.eager_load!
|
||||
|
||||
PaperTrail::Version.module_eval do
|
||||
self.abstract_class = true
|
||||
end
|
||||
|
||||
# Store console and rake changes in versions
|
||||
if defined?(::Rails::Console) || File.basename($PROGRAM_NAME).split(' ').first == 'spring'
|
||||
PaperTrail.whodunnit = "console-#{`whoami`.strip}"
|
||||
elsif File.basename($PROGRAM_NAME) == "rake"
|
||||
# rake username does not work when spring enabled
|
||||
PaperTrail.whodunnit = "rake-#{`whoami`.strip} #{ARGV.join ' '}"
|
||||
end
|
||||
|
||||
class PaperSession
|
||||
class << self
|
||||
attr_writer :session
|
||||
def session
|
||||
@session ||= Time.zone.now.to_s(:db)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
class Array
|
||||
def include_any? *args
|
||||
(self & args).any?
|
||||
end
|
||||
end
|
|
@ -1,3 +1,5 @@
|
|||
require 'devise_custom_failure'
|
||||
|
||||
# Use this hook to configure devise mailer, warden hooks and so forth.
|
||||
# Many of these configuration options can be set straight in your model.
|
||||
Devise.setup do |config|
|
||||
|
|
4
config/initializers/ext.rb
Normal file
4
config/initializers/ext.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
require 'core_ext/array'
|
||||
require 'gem_ext/builder'
|
||||
require 'gem_ext/i18n'
|
||||
require 'gem_ext/paper_trail'
|
|
@ -1 +0,0 @@
|
|||
Dir[File.join(Rails.root, 'lib', 'ext', '*.rb')].each { |x| require x }
|
|
@ -1,11 +0,0 @@
|
|||
# Don't raise error when nil
|
||||
# http://stackoverflow.com/questions/9467034/rails-i18n-how-to-handle-case-of-a-nil-date-being-passed-ie-lnil
|
||||
module I18n
|
||||
class << self
|
||||
alias_method :original_localize, :localize
|
||||
|
||||
def localize(object, options = {})
|
||||
object.present? ? original_localize(object, options) : ''
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue