Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
j_platform / app / models / j_platform / ticket / resolution.rb
Size: Mime:
module JPlatform
  class Ticket::Resolution < ::PlatformResource
    schema do
      string  :type, :code, :name, :client_id
    end
    self.site = JPlatform::Default.endpoint + "/api/v1/ticket"

    belongs_to :client, class_name: 'JPlatform::Client'
    has_many :tickets, class_name: 'JPlatform::Ticket'
    validates :name, presence: { message: I18n.t('tickets._create_edit_resolution.error_description') }, length: { maximum: 60, message: I18n.t('tickets._create_edit_resolution.error_message_too_long') }

    MAX_CODE_LENGTH = 10
    validates :code, presence: { message: I18n.t('tickets._create_edit_resolution.error_code_missing') }, length: { maximum: MAX_CODE_LENGTH, message: I18n.t('tickets._create_edit_resolution.error_code_too_long', max_length: MAX_CODE_LENGTH+1) }

    def to_s
      "#{code} - #{name}"
    end

    def to_partial_path
      'j_platform/admin/ticket/resolutions/resolution'
    end

  end
end