Skip to content

Instantly share code, notes, and snippets.

@MarkBennett
Created November 8, 2012 21:51
Show Gist options
  • Save MarkBennett/4041931 to your computer and use it in GitHub Desktop.
Save MarkBennett/4041931 to your computer and use it in GitHub Desktop.
Question copier
source_topic = Topic.find(2813)
destination_topic_id = 2811
source_topic.questions.each do |q|
attribs = {
account_id: q.account_id,
created_by: q.created_by,
item_bank_id: q.item_bank_id,
topic_id: destination_topic_id,
points: q.point,
angoff_score: q.angoff_score,
grading: q.grading,
shared: q.shared,
metadata: q.metadata,
content_en: "RNEC\n\n" + q.content_en,
content_fr: "RNEC\n\n" + q.content_fr
}
Question.new(attribs)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment