forked from bofh/fetsite
add picture to neuigkeit
This commit is contained in:
@@ -14,13 +14,14 @@
|
||||
|
||||
class Neuigkeit < ActiveRecord::Base
|
||||
|
||||
attr_accessible :datum, :text, :title, :rubrik_id, :author_id
|
||||
attr_accessible :datum, :text, :title, :rubrik_id, :author_id,:picture
|
||||
belongs_to :author, :class_name =>'User'
|
||||
belongs_to :rubrik, :class_name =>'Rubrik', :foreign_key => "rubrik_id"
|
||||
validates :rubrik, :presence=>true
|
||||
validates :author, :presence=>true
|
||||
translates :title,:text, :versioning=>true, :fallbacks_for_empty_translations => true
|
||||
has_one :calentry, :as => :object
|
||||
mount_uploader :picture, PictureUploader
|
||||
scope :published, -> {where("datum >= ? AND datum IS NOT NULL", Time.now.to_date)}
|
||||
scope :recent, -> { published.where("updated_at >= ? ",Time.now - 7.days)}
|
||||
def datum_nilsave
|
||||
|
||||
Reference in New Issue
Block a user