Sha256: 893d61d1505a7edd5d5a362390a16560b2d1f7487559e481e1aebfd6323b1d85
Contents?: true
Size: 618 Bytes
Versions: 1
Compression:
Stored size: 618 Bytes
Contents
# frozen_string_literal: true module ConvenientService module Examples module Rails class Gemfile module Services class AssertFileNotEmpty include RailsService::Config attribute :path, :string validates :path, presence: true if ConvenientService::Dependencies.support_has_j_send_result_params_validations_using_active_model_validations? def result return error(message: "File with path `#{path}` is empty") if ::File.zero?(path) success end end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
convenient_service-0.13.0 | lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb |