You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mechanism by which Filestack helpers are included in ActionController::Base is resulting in deprecation warnings which will soon be errors in Rails
#238
This is observed as of the latest filestack-rails release i.e. 5.4.1 and the version of Rails in which this was discovered was 6.0.3.4.
The deprecation warning is as follows:
DEPRECATION WARNING: Initialization autoloaded the constants FilestackRails::ApplicationHelper, FilestackRails::FormHelper,...
Being able to do this is deprecated. Autoloading during initialization is going
to be an error condition in future versions of Rails.
Reloading does not reboot the application, and therefore code executed during
initialization does not run again. So, if you reload FilestackRails::ApplicationHelper, for example,
the expected changes won't be reflected in that stale Module object.
Currently the FilestackRails Engine is injecting its helpers in by using a pattern which will in future versions of Rails will result in a hard error instead of a deprecation warning. The following lines are the culprits:
initializer 'filestack_rails.action_controller' do |app| #<- this block
ActiveSupport.on_load(:action_controller) do
::ActionController::Base.helper(FilestackRails::ApplicationHelper)
end
end
initializer "filestack_rails.form_builder" do #<- this block
ActionView::Helpers::FormBuilder.send(:include, FilestackRails::FormHelper)
end
end
end
The text was updated successfully, but these errors were encountered:
This is observed as of the latest filestack-rails release i.e. 5.4.1 and the version of Rails in which this was discovered was 6.0.3.4.
The deprecation warning is as follows:
Currently the FilestackRails Engine is injecting its helpers in by using a pattern which will in future versions of Rails will result in a hard error instead of a deprecation warning. The following lines are the culprits:
module FilestackRails
class Engine < ::Rails::Engine
config.filestack_rails = FilestackRails::Configuration.new
isolate_namespace FilestackRails
end
end
The text was updated successfully, but these errors were encountered: