|
|
|
@ -4,10 +4,12 @@ class SubjectIndexFormComponent < BaseComponent |
|
|
|
def initialize(current_user:, subject_index:, opts:) |
|
|
|
def initialize(current_user:, subject_index:, opts:) |
|
|
|
@subject_index = subject_index |
|
|
|
@subject_index = subject_index |
|
|
|
@opts = opts |
|
|
|
@opts = opts |
|
|
|
@parent_id = @opts[:parent_id] |
|
|
|
@parent_id = opts[:parent_id] |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def parent |
|
|
|
def parent |
|
|
|
|
|
|
|
return if parent_id.blank? |
|
|
|
|
|
|
|
|
|
|
|
Cdao::Subject.find(parent_id) |
|
|
|
Cdao::Subject.find(parent_id) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|