Class ConfigAttachment
In: app/models/config_attachment.rb
Parent: ActiveRecord::Base

添付ファイルの設定のモデル

Methods

Classes and Modules

Class ConfigAttachment::MaximumLengthError

Public Class methods

各ドメインの現在の設定を返す。

[Source]

    # File app/models/config_attachment.rb, line 29
29:   def self.current
30:     find(:first)
31:   end

Public Instance methods

設定されているファイルの上限サイズを length が越えないかどうか判定する。

[Source]

    # File app/models/config_attachment.rb, line 34
34:   def validate_length(length)
35:     if length > maximum_length
36:       raise MaximumLengthError, "exceeded maximum file length (= #{maximum_length}): #{length}"
37:     end
38:     return true
39:   end

[Validate]