Browse Source

Simplify

pull/73/head
baarkerlounger 4 years ago
parent
commit
7b0f6ac3b2
  1. 2
      app/models/case_log.rb

2
app/models/case_log.rb

@ -15,7 +15,7 @@ class CaseLogValidator < ActiveModel::Validator
public_send("validate_#{question_to_validate}", record) public_send("validate_#{question_to_validate}", record)
end end
else else
validation_methods = public_methods.select { |method| method.starts_with?("validate") } - [__callee__] validation_methods = public_methods.select { |method| method.starts_with?("validate_") }
validation_methods.each { |meth| public_send(meth, record) } validation_methods.each { |meth| public_send(meth, record) }
end end
end end

Loading…
Cancel
Save