Merge remote-tracking branch 'origin/documentmeeting' into documentmeeting

Conflicts:
	app/controllers/documents_controller.rb
	app/controllers/meetings_controller.rb
	app/models/ability.rb
	app/models/document.rb
	app/models/meeting.rb
	app/models/meetingtyp.rb
	app/views/documents/_document.html.erb
	app/views/documents/_nested_form.html.erb
	app/views/documents/edit.js.erb
	app/views/documents/new.js.erb
	app/views/meetings/_meeting.html.erb
	app/views/themen/_small.html.erb
	config/routes.rb
This commit is contained in:
Andreas Stephanides
2014-12-16 09:00:43 +01:00
13 changed files with 65 additions and 3 deletions

View File

@@ -116,6 +116,7 @@ class Ability
cannot :delete, Neuigkeit
end
# Calendar
if( user.has_role?("fetuser") || user.has_role?("fetadmin"))
can :manage, Document
can :manage, Meeting

View File

@@ -1,10 +1,13 @@
class Document < ActiveRecord::Base
attr_accessible :etherpadkey, :name, :parent, :text, :typ, :parent_id, :parent_type
belongs_to :parent, :polymorphic => true
validate :name, :length=>{minimum:3}
validate :text, :presence=>true
validate :typ, :presence=>true
validate :parent, :presence=>true
def self.new_divid_for(parent)
"document_new_parent_" + parent.class.to_s + "_" + parent.id.to_s
end

View File

@@ -1,6 +1,7 @@
class Meeting < ActiveRecord::Base
belongs_to :parent, :polymorphic=>true
belongs_to :meetingtyp
attr_accessible :desc, :intern, :name, :parent_id, :parent_type, :calentry,:calentry_attributes, :meetingtyp_id
belongs_to :neuigkeit
@@ -60,6 +61,7 @@ class Meeting < ActiveRecord::Base
self.agenda=d
end
end
<<<<<<< HEAD
def self.new_divid_for(parent)
"meeting_new_parent_" + parent.class.to_s + "_" + parent.id.to_s
end
@@ -68,4 +70,6 @@ class Meeting < ActiveRecord::Base
end
=======
>>>>>>> origin/documentmeeting
end

View File

@@ -2,4 +2,5 @@ class Meetingtyp < ActiveRecord::Base
attr_accessible :agendaintern, :desc, :name, :protocolintern
belongs_to :rubrik
validate :rubrik, :presence=>true
end