Sha256: ff27f80c9e6a97f0698a5608a6d3b04612229f23ba23ab291c262e2ce52e90a0

Contents?: true

Size: 365 Bytes

Versions: 17

Compression:

Stored size: 365 Bytes

Contents

require 'acts_as_list'
module Symphonia
  class Attachment < ApplicationRecord
    self.table_name = 'attachments'

    belongs_to :attachable, polymorphic: true, touch: true, optional: true
    acts_as_list scope: :attachable

    scope :like, proc {|q| where(arel_table[:description].matches("%#{q}%"))}

    def name
      attachment_file_name
    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
symphonia-3.2.4 app/models/symphonia/attachment.rb
symphonia-3.2.3 app/models/symphonia/attachment.rb
symphonia-3.2.2 app/models/symphonia/attachment.rb
symphonia-3.2.1 app/models/symphonia/attachment.rb
symphonia-3.1.5 app/models/symphonia/attachment.rb
symphonia-3.1.4 app/models/symphonia/attachment.rb
symphonia-3.1.3 app/models/symphonia/attachment.rb
symphonia-3.1.2 app/models/symphonia/attachment.rb
symphonia-3.1.1 app/models/symphonia/attachment.rb
symphonia-3.1.0 app/models/symphonia/attachment.rb
symphonia-3.0.3 app/models/symphonia/attachment.rb
symphonia-3.0.2 app/models/symphonia/attachment.rb
symphonia-2.2.1 app/models/symphonia/attachment.rb
symphonia-3.0.1 app/models/symphonia/attachment.rb
symphonia-3.0.0 app/models/symphonia/attachment.rb
symphonia-2.1.8 app/models/symphonia/attachment.rb
symphonia-2.1.7 app/models/symphonia/attachment.rb