Ability to give a statement

This commit is contained in:
2017-04-13 17:16:03 +02:00
parent b30bd91f3d
commit dd5e22ea48
66 changed files with 812 additions and 25 deletions
+26
View File
@@ -0,0 +1,26 @@
class Publicity
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Paperclip
has_mongoid_attached_file :avatar,
path: ':attachment/:id/:style.:extension',
styles: {
original: ['1920x1680>', :jpg],
small: ['100x100#', :jpg],
medium: ['250x250', :jpg],
large: ['500x500>', :jpg]
},
convert_options: { all: '-background white -flatten +matte' }
embedded_in :supporter
field :state, type: String, default: 'pending' # Possible states: pending, approved
field :organisation, type: String
field :statement, type: String
validates :state, presence: true
validates :avatar, presence: true
validates :statement, presence: true
validates_attachment_content_type :avatar, content_type: /\Aimage/
end