mirror of
https://github.com/heartcombo/simple_form.git
synced 2022-11-09 12:19:26 -05:00
cac943e891
I noticed these files all had strings such as "", " ", "_" that were allocated each time some common methods were called, over 1000x on a page in my app. This comment freezes all of these strings such that they're only allocated once, saving many KB of memory allocation.
15 lines
459 B
Ruby
15 lines
459 B
Ruby
# frozen_string_literal: true
|
|
require 'rails/railtie'
|
|
|
|
module SimpleForm
|
|
class Railtie < Rails::Railtie
|
|
config.eager_load_namespaces << SimpleForm
|
|
|
|
config.after_initialize do
|
|
unless SimpleForm.configured?
|
|
warn '[Simple Form] Simple Form is not configured in the application and will use the default values.' +
|
|
' Use `rails generate simple_form:install` to generate the Simple Form configuration.'
|
|
end
|
|
end
|
|
end
|
|
end
|