class ActiveStorage::Filename

def base

ActiveStorage::Filename.new(".gitignore").base # => ".gitignore"
ActiveStorage::Filename.new("racecar").base # => "racecar"
ActiveStorage::Filename.new("racecar.jpg").base # => "racecar"

Returns the part of the filename preceding any extension.
def base
  File.basename @filename, extension_with_delimiter
end