Skip to content

Instantly share code, notes, and snippets.

@foxweb
Created July 4, 2014 16:25
Show Gist options
  • Save foxweb/c0507a0020e6089376ce to your computer and use it in GitHub Desktop.
Save foxweb/c0507a0020e6089376ce to your computer and use it in GitHub Desktop.
types = %w(people companies places events type1 type2 type3 type4 type5 type6)
positions =* (1..10)
Document.all.each do |document|
puts 'Document GID: ' + document.gid.to_s
positions.each do |position|
tagging = Tagging.create do |tagging|
tagging.document_gid = document.gid
tagging.type = types.sample
tagging.zone_id = document.zone_id
tagging.position = position
end
puts ' Tagging: ' + tagging.id.to_s
end
end
@foxweb
Copy link
Author

foxweb commented Jul 7, 2014

В populate.rake сделал такое.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment