surveyor 0.6.9 → 0.6.10

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -7,12 +7,12 @@ Surveyor is a rails (gem) plugin, that brings surveys to your rails app. Before
7
7
  As a plugin:
8
8
 
9
9
  sudo gem install haml
10
- script/plugin install git://github.com/breakpointer/surveyor.git -r 'tag v0.6.9'
10
+ script/plugin install git://github.com/breakpointer/surveyor.git -r 'tag v0.6.10'
11
11
 
12
12
  Or as a gem plugin:
13
13
 
14
14
  # in environment.rb
15
- config.gem "surveyor", :version => '>=0.6.9', :source => 'http://gemcutter.org'
15
+ config.gem "surveyor", :version => '>=0.6.10', :source => 'http://gemcutter.org'
16
16
 
17
17
  sudo gem install gemcutter
18
18
  gem tumble
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.9
1
+ 0.6.10
@@ -40,6 +40,7 @@ class SurveyorController < ApplicationController
40
40
  @survey = Survey.with_sections.find_by_id(@response_set.survey_id)
41
41
  @sections = @survey.sections
42
42
  @section = params[:section] ? @sections.with_includes.find(section_id_from(params[:section])) || @sections.with_includes.first : @sections.with_includes.first
43
+ @questions = @section.questions.in_order
43
44
  else
44
45
  flash[:notice] = "Unable to find your responses to the survey"
45
46
  redirect_to(available_surveys_path)
@@ -8,6 +8,7 @@ class Question < ActiveRecord::Base
8
8
 
9
9
  # Scopes
10
10
  default_scope :order => "display_order ASC"
11
+ named_scope :in_order, {:order => "display_order ASC"}
11
12
 
12
13
  # Validations
13
14
  validates_presence_of :text, :survey_section_id, :display_order
@@ -20,12 +20,12 @@
20
20
  %span.title= @section.title
21
21
  .questions
22
22
  - group_questions ||= []
23
- - @section.questions.each_with_index do |question, index|
23
+ - @questions.each_with_index do |question, index|
24
24
  - unless question.part_of_group?
25
25
  = render(:partial => "/partials/question", :locals => {:question => question, :response_set => @response_set})
26
26
  - else # gather up the group questions
27
27
  - group_questions << question
28
- - if (index + 1 >= @section.questions.size) or (question.question_group_id != @section.questions[index + 1].question_group_id)
28
+ - if (index + 1 >= @questions.size) or (question.question_group_id != @questions[index + 1].question_group_id)
29
29
  - # this is the last question of the section, or the group
30
30
  = render(:partial => "/partials/question_group", :locals => {:question_group => question.question_group, :response_set => @response_set, :group_questions => group_questions})
31
31
  - group_questions = []
data/surveyor.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{surveyor}
8
- s.version = "0.6.9"
8
+ s.version = "0.6.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Brian Chamberlain", "Mark Yoon"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: surveyor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.9
4
+ version: 0.6.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Chamberlain