README.md in pollster-0.2.0 vs README.md in pollster-0.2.1
- old
+ new
@@ -36,11 +36,11 @@
Calculate the margin between Obama and Romney from a recent general election poll
poll = Poll.where(:chart => '2012-general-election-romney-vs-obama').first
responses = poll.questions.detect { |question| question.chart == '2012-general-election-romney-vs-obama' }.responses
- obama = responses.detect { |response| response.choice == "Obama" }
- romney = responses.detect { |response| response.choice == "Romney" }
+ obama = responses.detect { |response| response[:choice] == "Obama" }
+ romney = responses.detect { |response| response[:choice] == "Romney" }
obama[:value] - romney[:value]
See the methodology used in recent polls about the Affordable Care Act
chart = Chart.find 'us-health-bill'