sanitazion earlier
This commit is contained in:
@@ -27,7 +27,7 @@ class Neuigkeit < ActiveRecord::Base
|
|||||||
scope :unpublished, -> {where("datum >= ? OR datum IS NULL", Date.today)}
|
scope :unpublished, -> {where("datum >= ? OR datum IS NULL", Date.today)}
|
||||||
scope :public, ->{includes(:rubrik).where("rubriken.public"=>:true)}
|
scope :public, ->{includes(:rubrik).where("rubriken.public"=>:true)}
|
||||||
accepts_nested_attributes_for :calentries, :allow_destroy=>true , :reject_if=> lambda{|a| a[:start].blank?}
|
accepts_nested_attributes_for :calentries, :allow_destroy=>true , :reject_if=> lambda{|a| a[:start].blank?}
|
||||||
before_save :sanitize
|
before_validation :sanitize
|
||||||
def datum_nilsave
|
def datum_nilsave
|
||||||
self.datum.nil? ? Time.now + 42.years : self.datum
|
self.datum.nil? ? Time.now + 42.years : self.datum
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user