Merge pull request #859 from internetee/remove-lib-from-autoload-path

Remove `lib` folder from autoload path
This commit is contained in:
Timo Võhmar 2018-06-14 13:20:22 +03:00 committed by GitHub
commit 2828f8ca72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 57 additions and 58 deletions

View file

@ -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

View file

@ -1,5 +0,0 @@
class Array
def include_any? *args
(self & args).any?
end
end

View file

@ -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|

View file

@ -0,0 +1,4 @@
require 'core_ext/array'
require 'gem_ext/builder'
require 'gem_ext/i18n'
require 'gem_ext/paper_trail'

View file

@ -1 +0,0 @@
Dir[File.join(Rails.root, 'lib', 'ext', '*.rb')].each { |x| require x }

View file

@ -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