fix association neuigkeit-calentry

statt inverse_of , as
This commit is contained in:
Andreas Stephanides
2013-11-28 10:51:08 +01:00
parent e7e91ac134
commit 8d0993a121

View File

@@ -20,7 +20,7 @@ class Neuigkeit < ActiveRecord::Base
validates :rubrik, :presence=>true
validates :author, :presence=>true
translates :title,:text, :versioning=>true, :fallbacks_for_empty_translations => true
has_many :calentries, inverse_of: :object
has_many :calentries, as: :object
mount_uploader :picture, PictureUploader
scope :published, -> {where("datum <= ? AND datum IS NOT NULL", Time.now.to_date).order(:datum).reverse_order}
scope :recent, -> { published.where("updated_at >= ? ",Time.now - 7.days)}