diff --git a/app/models/lva.rb b/app/models/lva.rb index 300e0e2..307133c 100755 --- a/app/models/lva.rb +++ b/app/models/lva.rb @@ -17,7 +17,7 @@ class Lva < ActiveRecord::Base has_paper_trail # Versionsverfolgung - attr_accessible :desc, :ects, :lvanr, :name, :stunden, :modul_ids, :semester_ids, :pruefungsinformation, :lernaufwand + attr_accessible :desc, :ects, :lvanr, :name, :stunden, :modul_ids, :semester_ids, :pruefungsinformation, :lernaufwand, :typ has_and_belongs_to_many :modul # Gehört zu einem Modul has_and_belongs_to_many :semester #Gehört zu einem Semester( derzeit nicht implementiert) @@ -29,6 +29,7 @@ class Lva < ActiveRecord::Base validates_presence_of :ects # ECTS vorhanden? validates :name, :presence=>true validates :name, :uniqueness=>true# Name Eingetragen? + validates :typ, :presence=>true validates_presence_of :stunden # Stunden Eingetragen? validates_presence_of :modul # Zugehöriges Modul eingetragen? (zumindest eines) def add_semesters diff --git a/app/views/lvas/_form.html.erb b/app/views/lvas/_form.html.erb index be3ef9d..5aa9135 100755 --- a/app/views/lvas/_form.html.erb +++ b/app/views/lvas/_form.html.erb @@ -8,8 +8,12 @@
- - <%= f.input :name, :wrapper_html=>{:class=>'span5'}%> +
+ <%= f.input :typ %> +
+ <%= f.input :name, :wrapper_html=>{:class=>'span10'}%> +
+
<%= f.input :lvanr, :wrapper_html=>{:class=>'span4'}%> diff --git a/app/views/lvas/show.html.erb b/app/views/lvas/show.html.erb index d5e5950..9063cca 100755 --- a/app/views/lvas/show.html.erb +++ b/app/views/lvas/show.html.erb @@ -4,7 +4,7 @@
-

<%= @lva.name %>

+

<%=@lva.typ.to_s + ' ' + @lva.name %>

Prüfungsinformation

<%= @lva.pruefungsinformation %> diff --git a/db/migrate/20130811191150_add_pruefungsinfos_to_lvas.rb b/db/migrate/20130811191150_add_pruefungsinfos_to_lvas.rb new file mode 100644 index 0000000..a4a2443 --- /dev/null +++ b/db/migrate/20130811191150_add_pruefungsinfos_to_lvas.rb @@ -0,0 +1,6 @@ +class AddPruefungsinfosToLvas < ActiveRecord::Migration + def change + add_column :lvas, :pruefungsinformation, :text + add_column :lvas, :lernaufwand, :text + end +end diff --git a/db/migrate/20130812070544_add_typ_to_lvas.rb b/db/migrate/20130812070544_add_typ_to_lvas.rb new file mode 100644 index 0000000..ed8c291 --- /dev/null +++ b/db/migrate/20130812070544_add_typ_to_lvas.rb @@ -0,0 +1,5 @@ +class AddTypToLvas < ActiveRecord::Migration + def change + add_column :lvas, :typ, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index c8266dc..66a1e19 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130811191150) do +ActiveRecord::Schema.define(:version => 20130812070544) do create_table "attachments", :force => true do |t| t.string "name" @@ -96,6 +96,7 @@ ActiveRecord::Schema.define(:version => 20130811191150) do t.integer "semester_id" t.text "pruefungsinformation" t.text "lernaufwand" + t.string "typ" end create_table "lvas_moduls", :id => false, :force => true do |t|