|
|
@ -1,5 +1,4 @@ |
|
|
|
class Form::Lettings::Questions::ManagingOrganisation < ::Form::Question |
|
|
|
class Form::Lettings::Questions::ManagingOrganisation < ::Form::Question |
|
|
|
attr_accessor :current_user, :log |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def initialize(id, hsh, page) |
|
|
|
def initialize(id, hsh, page) |
|
|
|
super |
|
|
|
super |
|
|
@ -10,7 +9,7 @@ class Form::Lettings::Questions::ManagingOrganisation < ::Form::Question |
|
|
|
@answer_options = answer_options |
|
|
|
@answer_options = answer_options |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def answer_options |
|
|
|
def answer_options(log = nil, current_user = nil) |
|
|
|
opts = { "" => "Select an option" } |
|
|
|
opts = { "" => "Select an option" } |
|
|
|
|
|
|
|
|
|
|
|
return opts unless ActiveRecord::Base.connected? |
|
|
|
return opts unless ActiveRecord::Base.connected? |
|
|
@ -33,19 +32,13 @@ class Form::Lettings::Questions::ManagingOrganisation < ::Form::Question |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def displayed_answer_options(log, user) |
|
|
|
def displayed_answer_options(log, user) |
|
|
|
@current_user = user |
|
|
|
answer_options(log, user) |
|
|
|
@log = log |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
answer_options |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def label_from_value(value, log = nil, user = nil) |
|
|
|
def label_from_value(value, log = nil, user = nil) |
|
|
|
@log = log |
|
|
|
|
|
|
|
@current_user = user |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return unless value |
|
|
|
return unless value |
|
|
|
|
|
|
|
|
|
|
|
answer_options[value] |
|
|
|
answer_options(log, user)[value] |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def derived? |
|
|
|
def derived? |
|
|
@ -53,8 +46,7 @@ class Form::Lettings::Questions::ManagingOrganisation < ::Form::Question |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def hidden_in_check_answers?(log, user = nil) |
|
|
|
def hidden_in_check_answers?(log, user = nil) |
|
|
|
@current_user = user |
|
|
|
user.nil? || !@page.routed_to?(log, user) |
|
|
|
@current_user.nil? || !@page.routed_to?(log, user) |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def enabled |
|
|
|
def enabled |
|
|
|