seeds.rb 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. # This file should contain all the record creation needed to seed the database with its default values.
  2. # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
  3. #
  4. # Examples:
  5. #
  6. # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
  7. # Character.create(name: 'Luke', movie: movies.first)
  8. license = License.new(id: 1, name: "GPLv3", url: "https://www.gnu.org/licenses/gpl-3.0.en.html")
  9. license.save
  10. license.logo.attach(io: File.open("custom_data/attachments/license/1/logo/1.svg"), filename: 'GPLv3.svg')
  11. license.save
  12. #tag = Tag.new(project_id: 1, tag: "tag.js")
  13. #tag.save
  14. #tag = Tag.new(project_id: 1, tag: "tag.html5")
  15. #tag.save
  16. #tag = Tag.new(project_id: 2, tag: "tag.html5")
  17. #tag.save
  18. #tag = Tag.new(project_id: 2, tag: "tag.js")
  19. #tag.save
  20. #tag = Tag.new(project_id: 2, tag: "tag.css3")
  21. #tag.save
  22. #tag = Tag.new(project_id: 2, tag: "tag.android")
  23. #tag.save
  24. #tag = Tag.new(project_id: 2, tag: "tag.ios")
  25. #tag.save
  26. #tag = Tag.new(project_id: 2, tag: "tag.java")
  27. #tag.save
  28. #tag = Tag.new(project_id: 2, tag: "tag.swift")
  29. #tag.save
  30. #tag = Tag.new(project_id: 2, tag: "tag.php")
  31. #tag.save
  32. #tag = Tag.new(project_id: 3, tag: "tag.ruby")
  33. #tag.save
  34. #tag = Tag.new(project_id: 3, tag: "tag.rails")
  35. #tag.save
  36. #tag = Tag.new(project_id: 3, tag: "tag.mysql")
  37. #tag.save
  38. #tag = Tag.new(project_id: 3, tag: "tag.html5")
  39. #tag.save
  40. #tag = Tag.new(project_id: 3, tag: "tag.js")
  41. #tag.save
  42. #tag = Tag.new(project_id: 4, tag: "tag.html5")
  43. #tag.save
  44. #tag = Tag.new(project_id: 4, tag: "tag.css3")
  45. #tag.save
  46. #tag = Tag.new(project_id: 4, tag: "tag.js")
  47. #tag.save
  48. #tag = Tag.new(project_id: 4, tag: "tag.php")
  49. #tag.save
  50. #tag = Tag.new(project_id: 4, tag: "tag.sqlite")
  51. #tag.save
  52. technology = Technology.new(id: 1, name: "PHP", nature: "1")
  53. technology.save
  54. technology.logo.attach(io: File.open("custom_data/attachments/technology/1/logo/1.png"), filename: 'php.png')
  55. technology.save
  56. technology = Technology.new(id: 2, name: "JavaScript", nature: "1")
  57. technology.save
  58. technology.logo.attach(io: File.open("custom_data/attachments/technology/2/logo/1.png"), filename: 'javascript.png')
  59. technology.save
  60. technology = Technology.new(id: 3, name: "Java", nature: "1")
  61. technology.save
  62. technology.logo.attach(io: File.open("custom_data/attachments/technology/3/logo/1.png"), filename: 'java.png')
  63. technology.save
  64. technology = Technology.new(id: 4, name: "Swift", nature: "1")
  65. technology.save
  66. technology.logo.attach(io: File.open("custom_data/attachments/technology/4/logo/1.png"), filename: 'swift.png')
  67. technology.save
  68. technology = Technology.new(id: 5, name: "Ruby", nature: "1")
  69. technology.save
  70. technology.logo.attach(io: File.open("custom_data/attachments/technology/5/logo/1.png"), filename: 'ruby.png')
  71. technology.save
  72. technology = Technology.new(id: 6, name: "Python", nature: "1")
  73. technology.save
  74. technology.logo.attach(io: File.open("custom_data/attachments/technology/6/logo/1.png"), filename: 'python.png')
  75. technology.save
  76. technology = Technology.new(id: 7, name: "C", nature: "1")
  77. technology.save
  78. technology.logo.attach(io: File.open("custom_data/attachments/technology/7/logo/1.png"), filename: 'c.png')
  79. technology.save
  80. technology = Technology.new(id: 8, name: "C++", nature: "1")
  81. technology.save
  82. technology.logo.attach(io: File.open("custom_data/attachments/technology/8/logo/1.png"), filename: 'cpp.png')
  83. technology.save
  84. technology = Technology.new(id: 9, name: "Bash", nature: "1")
  85. technology.save
  86. technology.logo.attach(io: File.open("custom_data/attachments/technology/9/logo/1.png"), filename: 'bash.png')
  87. technology.save
  88. technology = Technology.new(id: 10, name: "Powershell", nature: "1")
  89. technology.save
  90. technology.logo.attach(io: File.open("custom_data/attachments/technology/10/logo/1.png"), filename: 'powershell.png')
  91. technology.save
  92. technology = Technology.new(id: 11, name: "Rails", nature: "2")
  93. technology.save
  94. technology.logo.attach(io: File.open("custom_data/attachments/technology/11/logo/1.png"), filename: 'rails.png')
  95. technology.save
  96. technology = Technology.new(id: 12, name: "MySQL", nature: "3")
  97. technology.save
  98. technology.logo.attach(io: File.open("custom_data/attachments/technology/12/logo/1.png"), filename: 'mysql.png')
  99. technology.save
  100. technology = Technology.new(id: 13, name: "SQLite", nature: "3")
  101. technology.save
  102. technology.logo.attach(io: File.open("custom_data/attachments/technology/13/logo/1.png"), filename: 'sqlite.png')
  103. technology.save
  104. technology = Technology.new(id: 14, name: "Oracle Database", nature: "3")
  105. technology.save
  106. technology.logo.attach(io: File.open("custom_data/attachments/technology/14/logo/1.png"), filename: 'oracledb.png')
  107. technology.save
  108. technology = Technology.new(id: 15, name: "HTML5", nature: "4")
  109. technology.save
  110. technology.logo.attach(io: File.open("custom_data/attachments/technology/15/logo/1.png"), filename: 'html5.png')
  111. technology.save
  112. technology = Technology.new(id: 16, name: "CSS3", nature: "4")
  113. technology.save
  114. technology.logo.attach(io: File.open("custom_data/attachments/technology/16/logo/1.png"), filename: 'css3.png')
  115. technology.save
  116. technology = Technology.new(id: 17, name: "GNU/Linux", nature: "5")
  117. technology.save
  118. technology.logo.attach(io: File.open("custom_data/attachments/technology/17/logo/1.png"), filename: 'gnulinux.png')
  119. technology.save
  120. technology = Technology.new(id: 18, name: "MS Windows", nature: "5")
  121. technology.save
  122. technology.logo.attach(io: File.open("custom_data/attachments/technology/18/logo/1.png"), filename: 'windows.png')
  123. technology.save
  124. technology = Technology.new(id: 19, name: "Android", nature: "5")
  125. technology.save
  126. technology.logo.attach(io: File.open("custom_data/attachments/technology/19/logo/1.png"), filename: 'android.png')
  127. technology.save
  128. technology = Technology.new(id: 20, name: "iOS", nature: "5")
  129. technology.save
  130. technology.logo.attach(io: File.open("custom_data/attachments/technology/20/logo/1.png"), filename: 'ios.png')
  131. technology.save
  132. technology = Technology.new(id: 21, name: "GIT", nature: "6")
  133. technology.save
  134. technology.logo.attach(io: File.open("custom_data/attachments/technology/21/logo/1.png"), filename: 'git.png')
  135. technology.save
  136. technology = Technology.new(id: 22, name: "Apache", nature: "6")
  137. technology.save
  138. technology.logo.attach(io: File.open("custom_data/attachments/technology/22/logo/1.png"), filename: 'apache.png')
  139. technology.save
  140. technology = Technology.new(id: 23, name: "Maven", nature: "6")
  141. technology.save
  142. technology.logo.attach(io: File.open("custom_data/attachments/technology/23/logo/1.png"), filename: 'maven.png')
  143. technology.save
  144. technology = Technology.new(id: 24, name: "WebLogic", nature: "6")
  145. technology.save
  146. technology.logo.attach(io: File.open("custom_data/attachments/technology/24/logo/1.png"), filename: 'weblogic.png')
  147. technology.save
  148. target = UrlTarget.new(id: 1, name: "urltarget.1.name", summary: "urltarget.1.summary")
  149. target.save
  150. target.logo.attach(io: File.open("custom_data/attachments/urlTarget/1/logo/1.svg"), filename: 'website.svg')
  151. target.save
  152. target = UrlTarget.new(id: 2, name: "urltarget.2.name", summary: "urltarget.2.summary")
  153. target.save
  154. target.logo.attach(io: File.open("custom_data/attachments/urlTarget/2/logo/1.svg"), filename: 'github.svg')
  155. target.save
  156. target = UrlTarget.new(id: 3, name: "urltarget.3.name", summary: "urltarget.3.summary")
  157. target.save
  158. target.logo.attach(io: File.open("custom_data/attachments/urlTarget/3/logo/1.svg"), filename: 'googleplay.svg')
  159. target.save
  160. target = UrlTarget.new(id: 4, name: "urltarget.4.name", summary: "urltarget.4.summary")
  161. target.save
  162. target.logo.attach(io: File.open("custom_data/attachments/urlTarget/4/logo/1.svg"), filename: 'appstore.svg')
  163. target.save
  164. text = Text.new(user_id: nil, key: "urltarget.1.name", language: "es", text: "Sitio web")
  165. text.save
  166. text = Text.new(user_id: nil, key: "urltarget.1.name", language: "en", text: "Website")
  167. text.save
  168. text = Text.new(user_id: nil, key: "urltarget.1.name", language: "eu", text: "Web horria")
  169. text.save
  170. text = Text.new(user_id: nil, key: "urltarget.1.summary", language: "es", text: "Ir al sitio web.")
  171. text.save
  172. text = Text.new(user_id: nil, key: "urltarget.1.summary", language: "en", text: "Go to website.")
  173. text.save
  174. text = Text.new(user_id: nil, key: "urltarget.1.summary", language: "eu", text: "Web horria.")
  175. text.save
  176. text = Text.new(user_id: nil, key: "urltarget.2.name", language: "es", text: "Github")
  177. text.save
  178. text = Text.new(user_id: nil, key: "urltarget.2.name", language: "en", text: "Github")
  179. text.save
  180. text = Text.new(user_id: nil, key: "urltarget.2.name", language: "eu", text: "Github")
  181. text.save
  182. text = Text.new(user_id: nil, key: "urltarget.2.summary", language: "es", text: "Ver el código fuente en Github.")
  183. text.save
  184. text = Text.new(user_id: nil, key: "urltarget.2.summary", language: "en", text: "Checkout source code on Github.")
  185. text.save
  186. text = Text.new(user_id: nil, key: "urltarget.2.summary", language: "eu", text: "Kodea Github-n.")
  187. text.save
  188. text = Text.new(user_id: nil, key: "urltarget.3.name", language: "es", text: "Google Play")
  189. text.save
  190. text = Text.new(user_id: nil, key: "urltarget.3.name", language: "en", text: "Google Play")
  191. text.save
  192. text = Text.new(user_id: nil, key: "urltarget.3.name", language: "eu", text: "Google Play")
  193. text.save
  194. text = Text.new(user_id: nil, key: "urltarget.3.summary", language: "es", text: "Ver app en Google Play.")
  195. text.save
  196. text = Text.new(user_id: nil, key: "urltarget.3.summary", language: "en", text: "See on Google Play.")
  197. text.save
  198. text = Text.new(user_id: nil, key: "urltarget.3.summary", language: "eu", text: "Google Play-n.")
  199. text.save
  200. text = Text.new(user_id: nil, key: "urltarget.4.name", language: "es", text: "App Store")
  201. text.save
  202. text = Text.new(user_id: nil, key: "urltarget.4.name", language: "en", text: "App Store")
  203. text.save
  204. text = Text.new(user_id: nil, key: "urltarget.4.name", language: "eu", text: "App Store")
  205. text.save
  206. text = Text.new(user_id: nil, key: "urltarget.4.summary", language: "es", text: "Ver app en App Store.")
  207. text.save
  208. text = Text.new(user_id: nil, key: "urltarget.4.summary", language: "en", text: "See on Google Play.")
  209. text.save
  210. text = Text.new(user_id: nil, key: "urltarget.4.summary", language: "eu", text: "Google App Store-n.")
  211. text.save
  212. text = Text.new(user_id: nil, key: "sociallink.2.title", language: "es", text: "Ir a mi perfil en Github")
  213. text.save
  214. text = Text.new(user_id: nil, key: "sociallink.2.title", language: "en", text: "Check out my Github profile")
  215. text.save
  216. text = Text.new(user_id: nil, key: "sociallink.2.title", language: "eu", text: "Ir a mi perfil en Github")
  217. text.save
  218. text = Text.new(user_id: nil, key: "sociallink.3.title", language: "es", text: "Escríbeme por Telegram")
  219. text.save
  220. text = Text.new(user_id: nil, key: "sociallink.3.title", language: "en", text: "Drop me a line over Telegram")
  221. text.save
  222. text = Text.new(user_id: nil, key: "sociallink.3.title", language: "eu", text: "Escríbeme por Telegram")
  223. text.save
  224. text = Text.new(user_id: nil, key: "sociallink.4.title", language: "es", text: "Ver mi perfil en LinkedIn")
  225. text.save
  226. text = Text.new(user_id: nil, key: "sociallink.4.title", language: "en", text: "See my LinkedIn profile")
  227. text.save
  228. text = Text.new(user_id: nil, key: "sociallink.4.title", language: "eu", text: "Ver mi perfil en LinkedIn")
  229. text.save
  230. text = Text.new(user_id: nil, key: "sociallink.5.title", language: "es", text: "Ver mi perfil en Facebook")
  231. text.save
  232. text = Text.new(user_id: nil, key: "sociallink.5.title", language: "en", text: "See my Facebook profile")
  233. text.save
  234. text = Text.new(user_id: nil, key: "sociallink.5.title", language: "eu", text: "Ver mi perfil en Facebook")
  235. text.save
  236. text = Text.new(user_id: nil, key: "sociallink.6.title", language: "es", text: "Ver mi perfil en Twitter")
  237. text.save
  238. text = Text.new(user_id: nil, key: "sociallink.6.title", language: "en", text: "See my Twitter profile")
  239. text.save
  240. text = Text.new(user_id: nil, key: "sociallink.6.title", language: "eu", text: "Ver mi perfil en Twitter")
  241. text.save
  242. slink = SocialLink.new(id: 1, site_name: "eMail", pattern: "mailto:*", regexp: "^\S+@\S+\.\S+$", link_title: "sociallink.1.title")
  243. slink.save
  244. slink.logo.attach(io: File.open("custom_data/attachments/socialLink/1/logo/1.svg"), filename: 'email.svg')
  245. slink.save
  246. slink = SocialLink.new(id: 2, site_name: "Github", pattern: "https://github.com/*", regexp: "^.+$", link_title: "sociallink.2.title")
  247. slink.save
  248. slink.logo.attach(io: File.open("custom_data/attachments/socialLink/2/logo/1.svg"), filename: 'github.svg')
  249. slink.save
  250. slink = SocialLink.new(id: 3, site_name: "Telegram", pattern: "https://t.me/*", regexp: "^.+$", link_title: "sociallink.3.title")
  251. slink.save
  252. slink.logo.attach(io: File.open("custom_data/attachments/socialLink/3/logo/1.svg"), filename: 'telegram.svg')
  253. slink.save
  254. slink = SocialLink.new(id: 4, site_name: "LinkedIn", pattern: "https://www.linkedin.com/in/*", regexp: "^.+$", link_title: "sociallink.4.title")
  255. slink.save
  256. slink.logo.attach(io: File.open("custom_data/attachments/socialLink/4/logo/1.svg"), filename: 'linkedin.svg')
  257. slink.save
  258. slink = SocialLink.new(id: 5, site_name: "Facebook", pattern: "https://facebook.com/*", regexp: "^.+$", link_title: "sociallink.5.title")
  259. slink.save
  260. slink.logo.attach(io: File.open("custom_data/attachments/socialLink/5/logo/1.svg"), filename: 'facebook.svg')
  261. slink.save
  262. slink = SocialLink.new(id: 6, site_name: "Twitter", pattern: "https://twitter.com/*", regexp: "^.+$", link_title: "sociallink.6.title")
  263. slink.save
  264. slink.logo.attach(io: File.open("custom_data/attachments/socialLink/6/logo/1.svg"), filename: 'twitter.svg')
  265. slink.save