Skip to content

Commit

Permalink
Fixes NUBIC#482 Rails 4.1 breaks models/response_set_spec
Browse files Browse the repository at this point in the history
ActiveRecord relations no longer support the compact method
directly.  Use to_a first.
  • Loading branch information
kjayma committed Aug 10, 2014
1 parent d4fe8df commit b3988e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/surveyor/models/response_set_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def correct?
end
def correctness_hash
{ :questions => Survey.where(id: self.survey_id).includes(sections: :questions).first.sections.map(&:questions).flatten.compact.size,
:responses => responses.compact.size,
:responses => responses.to_a.compact.size,
:correct => responses.find_all(&:correct?).compact.size
}
end
Expand Down

0 comments on commit b3988e7

Please sign in to comment.