Class: Brightcontent::Attachment
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Brightcontent::Attachment
- Defined in:
- app/models/brightcontent/attachment.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.reposition!(positions) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'app/models/brightcontent/attachment.rb', line 19 def self.reposition!(positions) positions.map! &:to_i transaction do all.each do || .update_column :position, positions.index(.id) end end end |
Instance Method Details
#attachment_styles ⇒ Object
28 29 30 |
# File 'app/models/brightcontent/attachment.rb', line 28 def .merge(user_defined_styles) end |
#image? ⇒ Boolean
32 33 34 |
# File 'app/models/brightcontent/attachment.rb', line 32 def image? asset_content_type =~ %r{^(image|(x-)?application)/(bmp|gif|jpeg|jpg|pjpeg|png|x-png)$} end |