Merge branch 'kalender' of https://github.com/andreassteph/fetsite into calendar

Conflicts:
	app/assets/stylesheets/formtastic-changes.css.scss
	app/controllers/beispiele_controller.rb
	app/views/studien/_form.html.erb
	config/locales/de.yml
	config/routes.rb
This commit is contained in:
Thomas Blazek
2013-08-11 10:34:03 +02:00
60 changed files with 1575 additions and 8 deletions

5
app/models/calendar.rb Normal file
View File

@@ -0,0 +1,5 @@
class Calendar < ActiveRecord::Base
attr_accessible :name, :public, :picture
has_and_belongs_to_many :calentries
mount_uploader :picture, PictureUploader
end

17
app/models/calentry.rb Normal file
View File

@@ -0,0 +1,17 @@
class Calentry < ActiveRecord::Base
attr_accessible :ende, :start, :summary, :typ,:calendar_ids
has_and_belongs_to_many :calendars
validates :start, :presence => true
validates :typ, :presence => true
validate do |entry|
if entry.ende.nil?
errors.add(:ende, "Es muss ein Endzeitpunkt vorhanden sein")
end
end
def start_time
start
end
def name
summary
end
end