diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb index f5125d6..8e8c70d 100644 --- a/app/controllers/plans_controller.rb +++ b/app/controllers/plans_controller.rb @@ -154,18 +154,6 @@ end end - def warning - @plan = Plan.find(params[:id]) - authorize @plan - if user_signed_in? && @plan.readable_by(current_user.id) then - respond_to do |format| - format.json { render json: @plan.warning(params[:option_id]) } - end - else - render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false) - end - end - def export @plan = Plan.find(params[:id]) authorize @plan diff --git a/app/models/organisation.rb b/app/models/organisation.rb index 5aabbf0..004fcf4 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -9,7 +9,6 @@ has_many :dmptemplates has_many :sections has_many :users - has_many :option_warnings has_many :suggested_answers has_and_belongs_to_many :token_permission_types, join_table: "org_token_permissions" @@ -150,20 +149,6 @@ end ## - # takes in the id of, and returns an OptionWarning - # - # @param option_id [number] the id of the desired warning - # @return [OptionWarning] the specified warning - def warning(option_id) - warning = option_warnings.find_by_option_id(option_id) - if warning.nil? && !parent.nil? then - return parent.warning(option_id) - else - return warning - end - end - - ## # returns all published templates belonging to the organisation # # @return [Array] published dmptemplates diff --git a/app/models/plan.rb b/app/models/plan.rb index f25998c..f964fa4 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -173,19 +173,6 @@ end ## - # finds the specified warning for the plan's project's organisation - # - # @param option_id [Integer] the id to find the OptionWarning associated - # @return [OptionWarning] the desired OptionWarning - def warning(option_id) - if project.organisation.nil? - return nil - else - return project.organisation.warning(option_id) - end - end - - ## # determines if the plan is editable by the specified user # NOTE: This should be renamed to editable_by? # diff --git a/app/policies/plan_policy.rb b/app/policies/plan_policy.rb index 2d4d08a..585e2ac 100644 --- a/app/policies/plan_policy.rb +++ b/app/policies/plan_policy.rb @@ -52,7 +52,4 @@ @plan.readable_by(@user.id) end - def warning? - @plan.readable_by(@user.id) - end end \ No newline at end of file diff --git a/app/views/plans/_answer_form.html.erb b/app/views/plans/_answer_form.html.erb index 5f262ba..7a416d8 100644 --- a/app/views/plans/_answer_form.html.erb +++ b/app/views/plans/_answer_form.html.erb @@ -92,15 +92,6 @@ <%= f.input :options, :as => :select, :collection => options, :label => false, :input_html => { :multiple => false, :id => "options-#{question.id}" } %> <% end %> <% end %> - - - <% if question.option_comment_display == true then%> <%= label_tag("answer-text-#{question.id}".to_sym, t("helpers.comment")) %> diff --git a/db/migrate/20161115114309_drop_option_warning_table.rb b/db/migrate/20161115114309_drop_option_warning_table.rb new file mode 100644 index 0000000..4ce7c19 --- /dev/null +++ b/db/migrate/20161115114309_drop_option_warning_table.rb @@ -0,0 +1,5 @@ +class DropOptionWarningTable < ActiveRecord::Migration + def change + drop_table :option_warnings + end +end