lib/stitches/api_key.rb
# TODO: (jdlubrano)
# Once Rails 5 support is no longer necessary, we can simply call
# Rails.application.class.module_parent.  The module_parent method
# does not exist in Rails <= 5, though, so we need to gracefully fallback
# Rails.application.class.parent for Rails versions predating Rails 6.0.0.
(jdlubrano)
Once Rails 5 support is no longer necessary, we can simply call
Rails.application.class.module_parent.  The module_parent method
does not exist in Rails <= 5, though, so we need to gracefully fallback
Rails.application.class.parent for Rails versions predating Rails 6.0.0.
( jdlubrano ) Once Rails 5 support is no longer necessary we can simply call Rails . application . class . module_parent . The module_parent method does not exist in Rails < = 5 though so we need to gracefully fallback Rails . application . class . parent for Rails versions predating Rails 6 . 0 . 0 .
def rails_app_module
      application_class = Rails.application.class
      parent = application_class.try(:module_parent) || application_class.parent
      parent.to_s
    end
def rails_app_module application_class = Rails . application . class parent = application_class . try ( :module_parent ) || application_class . parent parent . to_s end
TODO: (jdlubrano)
Once Rails 5 support is no longer necessary, we can simply call
Rails.application.class.module_parent.
TODO : ( jdlubrano ) Once Rails 5 support is no longer necessary we can simply call Rails . application . class . module_parent .