lva nlink fix

This commit is contained in:
Andreas Stephanides
2014-11-28 20:48:22 +01:00
parent dc124e3810
commit 85c6985a06
2 changed files with 7 additions and 4 deletions

View File

@@ -205,6 +205,9 @@ class Lva < ActiveRecord::Base
text :lernaufwand text :lernaufwand
text :typ text :typ
text :name, :boost=>3.0 text :name, :boost=>3.0
text :lecturer_names do
lecturers.map { |l| l.name }
end
end end
def self.update_multiple_with_modul(hash,modul) def self.update_multiple_with_modul(hash,modul)
@@ -212,7 +215,7 @@ class Lva < ActiveRecord::Base
hash.each do |i,l| hash.each do |i,l|
lva=Lva.where(:lvanr=>l["lvanr"]).first if lva.nil? lva=Lva.where(:lvanr=>l["lvanr"]).first if lva.nil?
lva=Lva.new(l) if lva.nil? lva=Lva.new(l) if lva.nil?
lva.modul<<modul lva.modul<< modul
lva.modul.uniq! lva.modul.uniq!
lva.name=l["name"] lva.name=l["name"]
lva.lvanr=l["lvanr"] lva.lvanr=l["lvanr"]
@@ -226,7 +229,7 @@ class Lva < ActiveRecord::Base
lva.lernaufwand=l["lernaufwand"] lva.lernaufwand=l["lernaufwand"]
lva.typ=l["typ"] lva.typ=l["typ"]
lva.save lva.save
newlvas<<lva # newlvas<< lva #
end end
newlvas newlvas

View File

@@ -1,2 +1,2 @@
<h2><%= nlink.title unless nlink.nil? %></h2> <h2><%= nlink.typ_n.to_s + ' ' + nlink.title unless nlink.nil? %></h2>
<%= render :partial=> "lvas/lva", :object=>nlink unless nlink.nil? %> <% render :partial=> "lvas/lva", :object=>nlink unless nlink.nil? %>