Files
grecia/app/models/concerns/documentable.rb
dependabot[bot] f4203909db Bump rubocop from 1.56.4 to 1.61.0
This version fixes false negatives for Lint/SymbolConversion when using
string interpolation, for Style/RedundantArgument when using the safe
navigation operator, for Style/RedundantParentheses when logical
operators are involved and for Style/RedundantReturn with lambda ending
with return. We're applying the new rules.

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.56.4 to 1.61.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.56.4...v1.61.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-02 16:31:10 +02:00

23 lines
551 B
Ruby

module Documentable
extend ActiveSupport::Concern
included do
has_many :documents, as: :documentable, inverse_of: :documentable, dependent: :destroy
accepts_nested_attributes_for :documents, allow_destroy: true
end
module ClassMethods
def max_documents_allowed
Setting["uploads.documents.max_amount"].to_i
end
def max_file_size
Setting["uploads.documents.max_size"].to_i
end
def accepted_content_types
Setting["uploads.documents.content_types"]&.split || ["application/pdf"]
end
end
end