app/models/response_set.rb in surveyor-0.9.0 vs app/models/response_set.rb in surveyor-0.9.1
- old
+ new
@@ -1,8 +1,7 @@
class ResponseSet < ActiveRecord::Base
- include TinyCode
-
+
# Associations
belongs_to :survey
belongs_to :user
has_many :responses, :dependent => :destroy
@@ -23,10 +22,10 @@
default_args
end
def default_args
self.started_at ||= Time.now
- self.access_code = ResponseSet.make_tiny_code
+ self.access_code = Surveyor.make_tiny_code
end
def response_for(question_id, answer_id, group = nil)
found = responses.detect{|r| r.question_id == question_id && r.answer_id == answer_id && r.response_group.to_s == group.to_s}
found.blank? ? responses.new(:question_id => question_id, :answer_id => answer_id, :response_group => group) : found
\ No newline at end of file