Skip to content

Commit

Permalink
Fix teaching plan has many groups association
Browse files Browse the repository at this point in the history
  • Loading branch information
Envek committed Oct 31, 2013
1 parent 4de064f commit ad37af1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/teaching_plan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class TeachingPlan < ActiveRecord::Base
belongs_to :speciality
belongs_to :discipline
has_many :groups, through: :speciality, conditions: -> { {forming_year: forming_year} }
has_many :groups, through: :speciality, conditions: proc { {forming_year: forming_year} }

validates_presence_of :speciality_id, :discipline_id, :course, :semester, :forming_year
validates_numericality_of :course, :semester, :forming_year
Expand Down

0 comments on commit ad37af1

Please sign in to comment.