From rails 4, the parameters are not just pure hashes, they are
represented with ActionController::Parameters type(strong params).
In the attempts controller we are still comparing the answer_text with
Hash, so change that to ActionController::Parameters with this.
Since the minimum supported rails version is 4.2, we don't need to
test for pure Hash as it will always be ActionController::Parameters
in the versions later than 4.
Also, In rails 5, belongs_to adds the required validation by default with
it. Make it optional so that non-logged in users can also take the
survey.
From rails 4, the parameters are not just pure hashes, they are represented with ActionController::Parameters type(strong params). In the attempts controller we are still comparing the answer_text with Hash, so change that to ActionController::Parameters with this.
Since the minimum supported rails version is 4.2, we don't need to test for pure
Hash
as it will always beActionController::Parameters
in the versions later than 4.Also, In rails 5,
belongs_to
adds the required validation by default with it. Make it optional so that non-logged in users can also take the survey.Fixes #114 Also Fixes #145