platform 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (480) hide show
  1. data/.gitignore +21 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +14 -0
  4. data/Gemfile.lock +191 -0
  5. data/MIT-LICENSE +20 -0
  6. data/README.rdoc +5 -0
  7. data/Rakefile +37 -0
  8. data/app/assets/images/platform/.gitkeep +0 -0
  9. data/app/assets/images/platform/accept.png +0 -0
  10. data/app/assets/images/platform/action_tab_bkgd.gif +0 -0
  11. data/app/assets/images/platform/action_tab_white_bkgd.gif +0 -0
  12. data/app/assets/images/platform/add.png +0 -0
  13. data/app/assets/images/platform/apps/app_icon.gif +0 -0
  14. data/app/assets/images/platform/apps/app_logo.gif +0 -0
  15. data/app/assets/images/platform/arrow_down.gif +0 -0
  16. data/app/assets/images/platform/arrow_down.png +0 -0
  17. data/app/assets/images/platform/arrow_down_grey.png +0 -0
  18. data/app/assets/images/platform/arrow_right.gif +0 -0
  19. data/app/assets/images/platform/arrow_up.png +0 -0
  20. data/app/assets/images/platform/arrow_up_grey.png +0 -0
  21. data/app/assets/images/platform/bullet_go.png +0 -0
  22. data/app/assets/images/platform/buttons.png +0 -0
  23. data/app/assets/images/platform/cancel.png +0 -0
  24. data/app/assets/images/platform/clipboard_icon.gif +0 -0
  25. data/app/assets/images/platform/close.gif +0 -0
  26. data/app/assets/images/platform/cross.png +0 -0
  27. data/app/assets/images/platform/default_app_icon.gif +0 -0
  28. data/app/assets/images/platform/default_app_logo.gif +0 -0
  29. data/app/assets/images/platform/delete.png +0 -0
  30. data/app/assets/images/platform/disk.png +0 -0
  31. data/app/assets/images/platform/exclamation.png +0 -0
  32. data/app/assets/images/platform/eye.png +0 -0
  33. data/app/assets/images/platform/eye_not.png +0 -0
  34. data/app/assets/images/platform/field_sprite.gif +0 -0
  35. data/app/assets/images/platform/find.png +0 -0
  36. data/app/assets/images/platform/globe.gif +0 -0
  37. data/app/assets/images/platform/help.png +0 -0
  38. data/app/assets/images/platform/help/app_reg.png +0 -0
  39. data/app/assets/images/platform/help/app_reg_ext.png +0 -0
  40. data/app/assets/images/platform/help/app_reg_web.png +0 -0
  41. data/app/assets/images/platform/help/auth_desktop.png +0 -0
  42. data/app/assets/images/platform/help/auth_iframe.png +0 -0
  43. data/app/assets/images/platform/help/auth_iphone.png +0 -0
  44. data/app/assets/images/platform/help/auth_web.png +0 -0
  45. data/app/assets/images/platform/help/authorize.png +0 -0
  46. data/app/assets/images/platform/help/ext.png +0 -0
  47. data/app/assets/images/platform/help/login.png +0 -0
  48. data/app/assets/images/platform/help/login_desktop.png +0 -0
  49. data/app/assets/images/platform/help/login_iphone.png +0 -0
  50. data/app/assets/images/platform/help/login_web.png +0 -0
  51. data/app/assets/images/platform/help2.png +0 -0
  52. data/app/assets/images/platform/information.png +0 -0
  53. data/app/assets/images/platform/keyboard.png +0 -0
  54. data/app/assets/images/platform/language_selector_arrow.gif +0 -0
  55. data/app/assets/images/platform/left_quote.png +0 -0
  56. data/app/assets/images/platform/lightning.png +0 -0
  57. data/app/assets/images/platform/loading.gif +0 -0
  58. data/app/assets/images/platform/loading2.gif +0 -0
  59. data/app/assets/images/platform/loading3.gif +0 -0
  60. data/app/assets/images/platform/loading_animation.gif +0 -0
  61. data/app/assets/images/platform/loading_large.gif +0 -0
  62. data/app/assets/images/platform/lock.png +0 -0
  63. data/app/assets/images/platform/lock_add.png +0 -0
  64. data/app/assets/images/platform/lock_delete.png +0 -0
  65. data/app/assets/images/platform/lock_open.png +0 -0
  66. data/app/assets/images/platform/medals/bronze.png +0 -0
  67. data/app/assets/images/platform/medals/gold.png +0 -0
  68. data/app/assets/images/platform/medals/runner.png +0 -0
  69. data/app/assets/images/platform/medals/silver.png +0 -0
  70. data/app/assets/images/platform/minus_node.png +0 -0
  71. data/app/assets/images/platform/oauth/perm_tile.gif +0 -0
  72. data/app/assets/images/platform/oauth/right_grey.png +0 -0
  73. data/app/assets/images/platform/pencil.png +0 -0
  74. data/app/assets/images/platform/photo_silhouette.gif +0 -0
  75. data/app/assets/images/platform/pixel.gif +0 -0
  76. data/app/assets/images/platform/platform.png +0 -0
  77. data/app/assets/images/platform/platform2.png +0 -0
  78. data/app/assets/images/platform/platform3.png +0 -0
  79. data/app/assets/images/platform/platform4.png +0 -0
  80. data/app/assets/images/platform/platform5.png +0 -0
  81. data/app/assets/images/platform/plus.png +0 -0
  82. data/app/assets/images/platform/plus_node.png +0 -0
  83. data/app/assets/images/platform/random.png +0 -0
  84. data/app/assets/images/platform/random2.png +0 -0
  85. data/app/assets/images/platform/rating_star0.png +0 -0
  86. data/app/assets/images/platform/rating_star05.png +0 -0
  87. data/app/assets/images/platform/rating_star1.png +0 -0
  88. data/app/assets/images/platform/rating_stars.gif +0 -0
  89. data/app/assets/images/platform/rating_stars.psd +0 -0
  90. data/app/assets/images/platform/reply.png +0 -0
  91. data/app/assets/images/platform/right_quote.png +0 -0
  92. data/app/assets/images/platform/rotating_world.gif +0 -0
  93. data/app/assets/images/platform/script.png +0 -0
  94. data/app/assets/images/platform/script_edit.png +0 -0
  95. data/app/assets/images/platform/script_gear.png +0 -0
  96. data/app/assets/images/platform/site_sprite.gif +0 -0
  97. data/app/assets/images/platform/spinner.gif +0 -0
  98. data/app/assets/images/platform/star.png +0 -0
  99. data/app/assets/images/platform/table_edit.png +0 -0
  100. data/app/assets/images/platform/table_gear.png +0 -0
  101. data/app/assets/images/platform/table_multiple.png +0 -0
  102. data/app/assets/images/platform/thumb_down.png +0 -0
  103. data/app/assets/images/platform/thumb_up.png +0 -0
  104. data/app/assets/images/platform/top_left_stem.png +0 -0
  105. data/app/assets/images/platform/top_right_stem.png +0 -0
  106. data/app/assets/images/platform/translate_icn.gif +0 -0
  107. data/app/assets/images/platform/treeview/diffDoc.gif +0 -0
  108. data/app/assets/images/platform/treeview/diffFolder.gif +0 -0
  109. data/app/assets/images/platform/treeview/ftv2blank.gif +0 -0
  110. data/app/assets/images/platform/treeview/ftv2doc.gif +0 -0
  111. data/app/assets/images/platform/treeview/ftv2folderclosed.gif +0 -0
  112. data/app/assets/images/platform/treeview/ftv2folderopen.gif +0 -0
  113. data/app/assets/images/platform/treeview/ftv2lastnode.gif +0 -0
  114. data/app/assets/images/platform/treeview/ftv2link.gif +0 -0
  115. data/app/assets/images/platform/treeview/ftv2mlastnode.gif +0 -0
  116. data/app/assets/images/platform/treeview/ftv2mnode.gif +0 -0
  117. data/app/assets/images/platform/treeview/ftv2node.gif +0 -0
  118. data/app/assets/images/platform/treeview/ftv2plastnode.gif +0 -0
  119. data/app/assets/images/platform/treeview/ftv2pnode.gif +0 -0
  120. data/app/assets/images/platform/treeview/ftv2vertline.gif +0 -0
  121. data/app/assets/images/platform/wizard.png +0 -0
  122. data/app/assets/images/platform/world_link.png +0 -0
  123. data/app/assets/javascripts/platform/api_explorer.js +628 -0
  124. data/app/assets/javascripts/platform/application.js +9 -0
  125. data/app/assets/javascripts/platform/ftiens4.js +1197 -0
  126. data/app/assets/javascripts/platform/jsdk.js +539 -0
  127. data/app/assets/javascripts/platform/platform.js +447 -0
  128. data/app/assets/javascripts/platform/shortcut.js +223 -0
  129. data/app/assets/javascripts/platform/ua.js +147 -0
  130. data/app/assets/stylesheets/platform/api_explorer.css.scss +140 -0
  131. data/app/assets/stylesheets/platform/application.css.scss +6 -0
  132. data/app/assets/stylesheets/platform/components.css.scss +208 -0
  133. data/app/assets/stylesheets/platform/layout.css.scss +119 -0
  134. data/app/assets/stylesheets/platform/oauth.css +51 -0
  135. data/app/assets/stylesheets/platform/platform.css.scss +311 -0
  136. data/app/controllers/platform/admin/apps_controller.rb +99 -0
  137. data/app/controllers/platform/admin/base_controller.rb +60 -0
  138. data/app/controllers/platform/admin/categories_controller.rb +132 -0
  139. data/app/controllers/platform/admin/clientsdk_controller.rb +30 -0
  140. data/app/controllers/platform/admin/developers_controller.rb +30 -0
  141. data/app/controllers/platform/admin/exceptions_controller.rb +30 -0
  142. data/app/controllers/platform/admin/forum_controller.rb +34 -0
  143. data/app/controllers/platform/admin/metrics_controller.rb +42 -0
  144. data/app/controllers/platform/api/apps_controller.rb +40 -0
  145. data/app/controllers/platform/api/base_controller.rb +541 -0
  146. data/app/controllers/platform/apps_controller.rb +142 -0
  147. data/app/controllers/platform/base_controller.rb +127 -0
  148. data/app/controllers/platform/developer/api_explorer_controller.rb +56 -0
  149. data/app/controllers/platform/developer/apps_controller.rb +161 -0
  150. data/app/controllers/platform/developer/base_controller.rb +51 -0
  151. data/app/controllers/platform/developer/blog_controller.rb +29 -0
  152. data/app/controllers/platform/developer/dashboard_controller.rb +63 -0
  153. data/app/controllers/platform/developer/forum_controller.rb +85 -0
  154. data/app/controllers/platform/developer/help_controller.rb +113 -0
  155. data/app/controllers/platform/developer/info_controller.rb +41 -0
  156. data/app/controllers/platform/developer/registration_controller.rb +39 -0
  157. data/app/controllers/platform/developer/resources_controller.rb +30 -0
  158. data/app/controllers/platform/forum_controller.rb +74 -0
  159. data/app/controllers/platform/oauth_controller.rb +421 -0
  160. data/app/controllers/platform/ratings_controller.rb +61 -0
  161. data/app/helpers/platform/admin/categories_helper.rb +54 -0
  162. data/app/helpers/platform/apps_helper.rb +26 -0
  163. data/app/helpers/platform/developer/dashboard_helper.rb +42 -0
  164. data/app/helpers/platform/developer/help_helper.rb +45 -0
  165. data/app/helpers/platform_helper.rb +26 -0
  166. data/app/models/platform/application.rb +394 -0
  167. data/app/models/platform/application_category.rb +34 -0
  168. data/app/models/platform/application_developer.rb +30 -0
  169. data/app/models/platform/application_filter.rb +30 -0
  170. data/app/models/platform/application_log.rb +32 -0
  171. data/app/models/platform/application_log_filter.rb +34 -0
  172. data/app/models/platform/application_metric.rb +58 -0
  173. data/app/models/platform/application_metric_filter.rb +34 -0
  174. data/app/models/platform/application_permission.rb +30 -0
  175. data/app/models/platform/application_permission_filter.rb +30 -0
  176. data/app/models/platform/application_usage_metric.rb +58 -0
  177. data/app/models/platform/application_usage_metric_filter.rb +34 -0
  178. data/app/models/platform/application_user.rb +45 -0
  179. data/app/models/platform/application_user_filter.rb +34 -0
  180. data/app/models/platform/base_filter.rb +46 -0
  181. data/app/models/platform/category.rb +64 -0
  182. data/app/models/platform/daily_application_metric.rb +31 -0
  183. data/app/models/platform/developer.rb +45 -0
  184. data/app/models/platform/developer_filter.rb +26 -0
  185. data/app/models/platform/forum_message.rb +35 -0
  186. data/app/models/platform/forum_message_filter.rb +26 -0
  187. data/app/models/platform/forum_topic.rb +38 -0
  188. data/app/models/platform/forum_topic_filter.rb +26 -0
  189. data/app/models/platform/logged_exception.rb +290 -0
  190. data/app/models/platform/logged_exception_filter.rb +58 -0
  191. data/app/models/platform/media/image.rb +26 -0
  192. data/app/models/platform/media/media.rb +58 -0
  193. data/app/models/platform/monthly_application_metric.rb +31 -0
  194. data/app/models/platform/oauth/access_token.rb +57 -0
  195. data/app/models/platform/oauth/client_token.rb +38 -0
  196. data/app/models/platform/oauth/oauth_model_methods.rb +41 -0
  197. data/app/models/platform/oauth/oauth_token.rb +57 -0
  198. data/app/models/platform/oauth/oauth_token_filter.rb +34 -0
  199. data/app/models/platform/oauth/refresh_token.rb +47 -0
  200. data/app/models/platform/oauth/request_token.rb +50 -0
  201. data/app/models/platform/permission.rb +27 -0
  202. data/app/models/platform/rating.rb +43 -0
  203. data/app/models/platform/rating_filter.rb +30 -0
  204. data/app/models/platform/rollup_log.rb +27 -0
  205. data/app/models/platform/rollup_log_filter.rb +30 -0
  206. data/app/models/platform/total_application_metric.rb +40 -0
  207. data/app/models/platform/weekly_application_metric.rb +31 -0
  208. data/app/views/platform/admin/apps/_categories.html.erb +17 -0
  209. data/app/views/platform/admin/apps/_categories_scripts.html.erb +17 -0
  210. data/app/views/platform/admin/apps/_tabs.html.erb +25 -0
  211. data/app/views/platform/admin/apps/index.html.erb +32 -0
  212. data/app/views/platform/admin/apps/permissions.html.erb +7 -0
  213. data/app/views/platform/admin/apps/ratings.html.erb +7 -0
  214. data/app/views/platform/admin/apps/tokens.html.erb +18 -0
  215. data/app/views/platform/admin/apps/users.html.erb +7 -0
  216. data/app/views/platform/admin/apps/view.html.erb +170 -0
  217. data/app/views/platform/admin/categories/_tabs.html.erb +22 -0
  218. data/app/views/platform/admin/categories/category_assigner.html.erb +9 -0
  219. data/app/views/platform/admin/categories/category_assigner_tree.html.erb +81 -0
  220. data/app/views/platform/admin/categories/index.html.erb +106 -0
  221. data/app/views/platform/admin/categories/items.html.erb +153 -0
  222. data/app/views/platform/admin/categories/lb_update_application_category.html.erb +54 -0
  223. data/app/views/platform/admin/categories/lb_update_category.html.erb +64 -0
  224. data/app/views/platform/admin/categories/tree.html.erb +64 -0
  225. data/app/views/platform/admin/clientsdk/index.html.erb +89 -0
  226. data/app/views/platform/admin/common/_footer.html.erb +1 -0
  227. data/app/views/platform/admin/common/_header.html.erb +32 -0
  228. data/app/views/platform/admin/common/_lightbox_buttons.html.erb +5 -0
  229. data/app/views/platform/admin/common/_paginator.html.erb +20 -0
  230. data/app/views/platform/admin/developers/_tabs.html.erb +22 -0
  231. data/app/views/platform/admin/developers/index.html.erb +7 -0
  232. data/app/views/platform/admin/exceptions/_tabs.html.erb +22 -0
  233. data/app/views/platform/admin/exceptions/index.html.erb +7 -0
  234. data/app/views/platform/admin/forum/_tabs.html.erb +22 -0
  235. data/app/views/platform/admin/forum/index.html.erb +7 -0
  236. data/app/views/platform/admin/forum/messages.html.erb +7 -0
  237. data/app/views/platform/admin/metrics/_tabs.html.erb +25 -0
  238. data/app/views/platform/admin/metrics/application_log.html.erb +7 -0
  239. data/app/views/platform/admin/metrics/index.html.erb +9 -0
  240. data/app/views/platform/admin/metrics/rollup_log.html.erb +7 -0
  241. data/app/views/platform/admin/metrics/usage.html.erb +7 -0
  242. data/app/views/platform/apps/_actions_module.html.erb +3 -0
  243. data/app/views/platform/apps/_app_footer.html.erb +8 -0
  244. data/app/views/platform/apps/_app_header.html.erb +25 -0
  245. data/app/views/platform/apps/_apps_module.html.erb +42 -0
  246. data/app/views/platform/apps/_authorize_form.html.erb +11 -0
  247. data/app/views/platform/apps/_categories_module.html.erb +11 -0
  248. data/app/views/platform/apps/_featured_apps_module.html.erb +40 -0
  249. data/app/views/platform/apps/_left.html.erb +20 -0
  250. data/app/views/platform/apps/_monthly_users_module.html.erb +8 -0
  251. data/app/views/platform/apps/_paginator.html.erb +13 -0
  252. data/app/views/platform/apps/_rank_module.html.erb +18 -0
  253. data/app/views/platform/apps/_search_apps_module.html.erb +35 -0
  254. data/app/views/platform/apps/canvas_app.html.erb +15 -0
  255. data/app/views/platform/apps/index.html.erb +86 -0
  256. data/app/views/platform/apps/view.html.erb +71 -0
  257. data/app/views/platform/apps/xd.html.erb +11 -0
  258. data/app/views/platform/common/_footer.html.erb +1 -0
  259. data/app/views/platform/common/_header.html.erb +4 -0
  260. data/app/views/platform/common/_paginator.html.erb +32 -0
  261. data/app/views/platform/common/_scripts.html.erb +7 -0
  262. data/app/views/platform/common/_user_login.html.erb +11 -0
  263. data/app/views/platform/developer/api_explorer/history.html.erb +31 -0
  264. data/app/views/platform/developer/api_explorer/index.html.erb +134 -0
  265. data/app/views/platform/developer/api_explorer/oauth_lander.html.erb +4 -0
  266. data/app/views/platform/developer/api_explorer/options.html.erb +44 -0
  267. data/app/views/platform/developer/apps/_form.html.erb +340 -0
  268. data/app/views/platform/developer/apps/create_version.html.erb +19 -0
  269. data/app/views/platform/developer/apps/edit.html.erb +21 -0
  270. data/app/views/platform/developer/apps/index.html.erb +375 -0
  271. data/app/views/platform/developer/apps/new.html.erb +20 -0
  272. data/app/views/platform/developer/blog/index.html.erb +7 -0
  273. data/app/views/platform/developer/common/_footer.html.erb +1 -0
  274. data/app/views/platform/developer/common/_header.html.erb +34 -0
  275. data/app/views/platform/developer/dashboard/_apps_info.html.erb +84 -0
  276. data/app/views/platform/developer/dashboard/_discussions.html.erb +68 -0
  277. data/app/views/platform/developer/dashboard/_header.html.erb +12 -0
  278. data/app/views/platform/developer/dashboard/_reviews.html.erb +53 -0
  279. data/app/views/platform/developer/dashboard/_statistics.html.erb +105 -0
  280. data/app/views/platform/developer/dashboard/index.html.erb +85 -0
  281. data/app/views/platform/developer/dashboard/settings.html.erb +23 -0
  282. data/app/views/platform/developer/forum/_message.html.erb +17 -0
  283. data/app/views/platform/developer/forum/_messages.html.erb +14 -0
  284. data/app/views/platform/developer/forum/_new_message.html.erb +28 -0
  285. data/app/views/platform/developer/forum/_new_topic.html.erb +39 -0
  286. data/app/views/platform/developer/forum/index.html.erb +89 -0
  287. data/app/views/platform/developer/forum/topic.html.erb +28 -0
  288. data/app/views/platform/developer/help/_footer.html.erb +4 -0
  289. data/app/views/platform/developer/help/_header.html.erb +95 -0
  290. data/app/views/platform/developer/help/_navigation.html.erb +99 -0
  291. data/app/views/platform/developer/help/api.html.erb +120 -0
  292. data/app/views/platform/developer/help/credits.html.erb +77 -0
  293. data/app/views/platform/developer/help/index.html.erb +19 -0
  294. data/app/views/platform/developer/help/license.html.erb +586 -0
  295. data/app/views/platform/developer/help/oauth_app_login.html.erb +177 -0
  296. data/app/views/platform/developer/help/oauth_client_side.html.erb +264 -0
  297. data/app/views/platform/developer/help/oauth_desktop.html.erb +191 -0
  298. data/app/views/platform/developer/help/oauth_extensions.html.erb +342 -0
  299. data/app/views/platform/developer/help/oauth_intro.html.erb +371 -0
  300. data/app/views/platform/developer/help/oauth_mobile.html.erb +292 -0
  301. data/app/views/platform/developer/help/oauth_server_side.html.erb +603 -0
  302. data/app/views/platform/developer/help/oauth_trusted_client.html.erb +202 -0
  303. data/app/views/platform/developer/help/reference.html.erb +42 -0
  304. data/app/views/platform/developer/help/sdk_ios.html.erb +31 -0
  305. data/app/views/platform/developer/help/sdk_js.html.erb +202 -0
  306. data/app/views/platform/developer/info/_basic_info.html.erb +74 -0
  307. data/app/views/platform/developer/info/_header.html.erb +12 -0
  308. data/app/views/platform/developer/info/index.html.erb +23 -0
  309. data/app/views/platform/developer/registration/index.html.erb +134 -0
  310. data/app/views/platform/developer/resources/index.html.erb +23 -0
  311. data/app/views/platform/forum/_message.html.erb +17 -0
  312. data/app/views/platform/forum/_messages.html.erb +14 -0
  313. data/app/views/platform/forum/_new_message.html.erb +26 -0
  314. data/app/views/platform/forum/_new_topic.html.erb +38 -0
  315. data/app/views/platform/forum/_topic.html.erb +18 -0
  316. data/app/views/platform/forum/_topics.html.erb +74 -0
  317. data/app/views/platform/login/index.html.erb +31 -0
  318. data/app/views/platform/login/register.html.erb +55 -0
  319. data/app/views/platform/oauth/_authorization_box.html.erb +75 -0
  320. data/app/views/platform/oauth/_authorization_popup.html.erb +38 -0
  321. data/app/views/platform/oauth/_authorize_form.html.erb +11 -0
  322. data/app/views/platform/oauth/auth_failed.html.erb +0 -0
  323. data/app/views/platform/oauth/auth_success.html.erb +0 -0
  324. data/app/views/platform/oauth/authorize_desktop.html.erb +76 -0
  325. data/app/views/platform/oauth/authorize_failure_iframe.html.erb +1 -0
  326. data/app/views/platform/oauth/authorize_failure_mobile.html.erb +24 -0
  327. data/app/views/platform/oauth/authorize_failure_popup.html.erb +24 -0
  328. data/app/views/platform/oauth/authorize_failure_web.html.erb +1 -0
  329. data/app/views/platform/oauth/authorize_iframe.html.erb +16 -0
  330. data/app/views/platform/oauth/authorize_mobile.html.erb +1 -0
  331. data/app/views/platform/oauth/authorize_popup.html.erb +1 -0
  332. data/app/views/platform/oauth/authorize_success_iframe.html.erb +1 -0
  333. data/app/views/platform/oauth/authorize_success_mobile.html.erb +24 -0
  334. data/app/views/platform/oauth/authorize_success_popup.html.erb +24 -0
  335. data/app/views/platform/oauth/authorize_success_web.html.erb +1 -0
  336. data/app/views/platform/oauth/authorize_web.html.erb +3 -0
  337. data/app/views/platform/oauth/xd.html.erb +13 -0
  338. data/app/views/platform/ratings/_list.html.erb +30 -0
  339. data/app/views/platform/ratings/_new.html.erb +70 -0
  340. data/app/views/platform/ratings/_rating.html.erb +17 -0
  341. data/config/platform/config.yml +133 -0
  342. data/config/platform/data/default_applications.yml +39 -0
  343. data/config/platform/data/default_categories.yml +56 -0
  344. data/config/platform/data/default_permissions.yml +0 -0
  345. data/config/platform/site/features.yml +66 -0
  346. data/config/routes.rb +59 -0
  347. data/db/migrate/20110602232141_create_platform_tables.rb +262 -0
  348. data/docs/Classes.graffle +7315 -0
  349. data/docs/Classes.pdf +0 -0
  350. data/lib/generators/platform/platform_generator.rb +56 -0
  351. data/lib/generators/platform/templates/db/create_platform_tables.rb +262 -0
  352. data/lib/generators/platform/templates/layouts/platform.html.erb +49 -0
  353. data/lib/generators/platform/templates/layouts/platform_admin.html.erb +60 -0
  354. data/lib/platform.rb +6 -0
  355. data/lib/platform/api/already_jsoned_string.rb +9 -0
  356. data/lib/platform/api/proxy.rb +45 -0
  357. data/lib/platform/api/proxy/base.rb +62 -0
  358. data/lib/platform/cache.rb +78 -0
  359. data/lib/platform/config.rb +666 -0
  360. data/lib/platform/engine.rb +5 -0
  361. data/lib/platform/exception.rb +27 -0
  362. data/lib/platform/extensions/action_controller_extension.rb +65 -0
  363. data/lib/platform/extensions/action_view_extension.rb +168 -0
  364. data/lib/platform/extensions/object_extension.rb +51 -0
  365. data/lib/platform/helper.rb +33 -0
  366. data/lib/platform/logger.rb +62 -0
  367. data/lib/platform/railtie.rb +52 -0
  368. data/lib/platform/random_password_generator.rb +76 -0
  369. data/lib/platform/simple_string_permissions.rb +40 -0
  370. data/lib/platform/version.rb +3 -0
  371. data/lib/tasks/platform.rake +119 -0
  372. data/platform.gemspec +45 -0
  373. data/script/rails +6 -0
  374. data/spec/config/config_spec.rb +10 -0
  375. data/spec/dummy_app.rb +52 -0
  376. data/spec/models/application_spec.rb +53 -0
  377. data/spec/models/developer_spec.rb +23 -0
  378. data/spec/spec_helper.rb +29 -0
  379. data/test/dummy/Rakefile +7 -0
  380. data/test/dummy/app/assets/javascripts/application.js +7 -0
  381. data/test/dummy/app/assets/stylesheets/admin.css +200 -0
  382. data/test/dummy/app/assets/stylesheets/application.css +47 -0
  383. data/test/dummy/app/assets/stylesheets/components.css.scss +211 -0
  384. data/test/dummy/app/assets/stylesheets/layout.css.scss +143 -0
  385. data/test/dummy/app/controllers/admin/admins_controller.rb +7 -0
  386. data/test/dummy/app/controllers/admin/base_controller.rb +12 -0
  387. data/test/dummy/app/controllers/admin/bookmarks_controller.rb +7 -0
  388. data/test/dummy/app/controllers/admin/users_controller.rb +19 -0
  389. data/test/dummy/app/controllers/api/base_controller.rb +5 -0
  390. data/test/dummy/app/controllers/api/bookmarks_controller.rb +35 -0
  391. data/test/dummy/app/controllers/api/users_controller.rb +19 -0
  392. data/test/dummy/app/controllers/application_controller.rb +31 -0
  393. data/test/dummy/app/controllers/home_controller.rb +7 -0
  394. data/test/dummy/app/controllers/login_controller.rb +65 -0
  395. data/test/dummy/app/helpers/application_helper.rb +9 -0
  396. data/test/dummy/app/helpers/home_helper.rb +2 -0
  397. data/test/dummy/app/mailers/.gitkeep +0 -0
  398. data/test/dummy/app/models/.gitkeep +0 -0
  399. data/test/dummy/app/models/admin.rb +4 -0
  400. data/test/dummy/app/models/admin_filter.rb +7 -0
  401. data/test/dummy/app/models/bookmark.rb +7 -0
  402. data/test/dummy/app/models/user.rb +34 -0
  403. data/test/dummy/app/views/admin/admins/index.html.erb +7 -0
  404. data/test/dummy/app/views/admin/bookmarks/index.html.erb +5 -0
  405. data/test/dummy/app/views/admin/users/index.html.erb +10 -0
  406. data/test/dummy/app/views/demo/index.rhtml +108 -0
  407. data/test/dummy/app/views/demo/tokens.rhtml +35 -0
  408. data/test/dummy/app/views/home/index.html.erb +43 -0
  409. data/test/dummy/app/views/layouts/_footer.html.erb +16 -0
  410. data/test/dummy/app/views/layouts/_header.html.erb +22 -0
  411. data/test/dummy/app/views/layouts/admin.html.erb +97 -0
  412. data/test/dummy/app/views/layouts/application.html.erb +25 -0
  413. data/test/dummy/app/views/layouts/minimal.html.erb +37 -0
  414. data/test/dummy/app/views/layouts/popup.html.erb +43 -0
  415. data/test/dummy/app/views/login/index.html.erb +34 -0
  416. data/test/dummy/app/views/login/register.html.erb +51 -0
  417. data/test/dummy/config.ru +4 -0
  418. data/test/dummy/config/application.rb +51 -0
  419. data/test/dummy/config/boot.rb +10 -0
  420. data/test/dummy/config/database.yml +25 -0
  421. data/test/dummy/config/environment.rb +5 -0
  422. data/test/dummy/config/environments/development.rb +30 -0
  423. data/test/dummy/config/environments/production.rb +60 -0
  424. data/test/dummy/config/environments/test.rb +42 -0
  425. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  426. data/test/dummy/config/initializers/inflections.rb +10 -0
  427. data/test/dummy/config/initializers/mime_types.rb +5 -0
  428. data/test/dummy/config/initializers/secret_token.rb +7 -0
  429. data/test/dummy/config/initializers/session_store.rb +8 -0
  430. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  431. data/test/dummy/config/locales/en.yml +5 -0
  432. data/test/dummy/config/platform/api/0/bookmark.yml +18 -0
  433. data/test/dummy/config/platform/api/0/user.yml +17 -0
  434. data/test/dummy/config/platform/api/1/bookmark.yml +58 -0
  435. data/test/dummy/config/platform/api/1/user.yml +36 -0
  436. data/test/dummy/config/platform/config.yml +135 -0
  437. data/test/dummy/config/platform/data/default_applications.yml +39 -0
  438. data/test/dummy/config/platform/data/default_categories.yml +56 -0
  439. data/test/dummy/config/platform/data/default_permissions.yml +0 -0
  440. data/test/dummy/config/platform/site/features.yml +66 -0
  441. data/test/dummy/config/platform/site/sample_apps.yml +100 -0
  442. data/test/dummy/config/routes.rb +30 -0
  443. data/test/dummy/config/tr8n/config.yml +247 -0
  444. data/test/dummy/config/tr8n/data/ip_locations.csv +93460 -0
  445. data/test/dummy/config/tr8n/rules/default_date_rules.yml +20 -0
  446. data/test/dummy/config/tr8n/rules/default_gender_list_rules.yml +82 -0
  447. data/test/dummy/config/tr8n/rules/default_gender_rules.yml +20 -0
  448. data/test/dummy/config/tr8n/rules/default_language_cases.yml +272 -0
  449. data/test/dummy/config/tr8n/rules/default_list_rules.yml +19 -0
  450. data/test/dummy/config/tr8n/rules/default_numeric_rules.yml +42 -0
  451. data/test/dummy/config/tr8n/rules/default_value_rules.yml +18 -0
  452. data/test/dummy/config/tr8n/site/default_glossary.yml +18 -0
  453. data/test/dummy/config/tr8n/site/default_languages.yml +1591 -0
  454. data/test/dummy/config/tr8n/site/features.yml +111 -0
  455. data/test/dummy/config/tr8n/site/shortcuts.yml +55 -0
  456. data/test/dummy/config/tr8n/site/sitemap.json +42 -0
  457. data/test/dummy/config/tr8n/tokens/data.yml +19 -0
  458. data/test/dummy/config/tr8n/tokens/decorations.yml +19 -0
  459. data/test/dummy/config/will_filter/config.yml +99 -0
  460. data/test/dummy/db/migrate/20101207014543_create_users.rb +23 -0
  461. data/test/dummy/db/migrate/20110113223509_create_admins.rb +15 -0
  462. data/test/dummy/db/migrate/20110930041143_create_will_filter_filters.rb +15 -0
  463. data/test/dummy/db/migrate/20110930041150_create_tr8n_tables.rb +350 -0
  464. data/test/dummy/db/migrate/20111004075531_create_platform_tables.rb +262 -0
  465. data/test/dummy/db/migrate/20111012055603_create_bookmarks.rb +10 -0
  466. data/test/dummy/db/schema.rb +683 -0
  467. data/test/dummy/lib/assets/.gitkeep +0 -0
  468. data/test/dummy/lib/platform/api/bookmark_proxy_0.rb +12 -0
  469. data/test/dummy/lib/platform/api/bookmark_proxy_1.rb +12 -0
  470. data/test/dummy/lib/platform/api/user_proxy_0.rb +12 -0
  471. data/test/dummy/lib/platform/api/user_proxy_1.rb +12 -0
  472. data/test/dummy/log/.gitkeep +0 -0
  473. data/test/dummy/public/404.html +26 -0
  474. data/test/dummy/public/422.html +26 -0
  475. data/test/dummy/public/500.html +26 -0
  476. data/test/dummy/public/favicon.ico +0 -0
  477. data/test/dummy/script/rails +6 -0
  478. data/test/dummy/test/fixtures/documents.yml +11 -0
  479. data/test/dummy/test/unit/document_test.rb +7 -0
  480. metadata +886 -0
@@ -0,0 +1,262 @@
1
+ class CreatePlatformTables < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :platform_developers do |t|
4
+ t.integer :user_id, :limit => 8, :null => false
5
+ t.string :name, :null => false
6
+ t.text :about
7
+ t.string :url
8
+ t.string :email
9
+ t.string :phone
10
+ t.timestamps
11
+ end
12
+ add_index :platform_developers, :user_id
13
+
14
+ create_table :platform_applications do |t|
15
+ t.integer :developer_id
16
+ t.string :name
17
+ t.text :description
18
+ t.string :state, :default => "new"
19
+ t.string :locale
20
+ t.string :url
21
+ t.string :site_domain
22
+ t.string :support_url
23
+ t.string :callback_url
24
+ t.string :contact_email
25
+ t.string :privacy_policy_url
26
+ t.string :terms_of_service_url
27
+ t.string :permissions
28
+ t.string :key
29
+ t.string :secret
30
+ t.integer :icon_id
31
+ t.integer :logo_id
32
+ t.string :canvas_name
33
+ t.string :canvas_url
34
+ t.boolean :auto_resize
35
+ t.boolean :auto_login
36
+ t.string :mobile_application_type
37
+ t.string :ios_bundle_id
38
+ t.string :itunes_app_store_id
39
+ t.string :android_key_hash
40
+ t.integer :rank
41
+ t.boolean :auto_signin
42
+ t.string :deauthorize_callback_url
43
+ t.string :version
44
+ t.string :api_version
45
+ t.integer :parent_id
46
+ t.timestamps
47
+ end
48
+ add_index :platform_applications, :developer_id
49
+ add_index :platform_applications, :key, :unique
50
+ add_index :platform_applications, :parent_id
51
+
52
+ create_table :platform_application_logs do |t|
53
+ t.integer :application_id
54
+ t.integer :user_id
55
+ t.string :event
56
+ t.string :controller
57
+ t.string :action
58
+ t.string :request_method
59
+ t.text :data
60
+ t.string :user_agent
61
+ t.integer :duration
62
+ t.string :host
63
+ t.string :country
64
+ t.string :ip
65
+ t.timestamps
66
+ end
67
+ add_index :platform_application_logs, [:application_id, :created_at]
68
+
69
+ create_table :platform_application_metrics do |t|
70
+ t.string :type
71
+ t.timestamp :interval
72
+ t.integer :application_id
73
+ t.integer :active_user_count
74
+ t.integer :new_user_count
75
+ t.timestamps
76
+ end
77
+ add_index :platform_application_metrics, [:application_id, :interval], :name => "pamai"
78
+
79
+ create_table :platform_application_usage_metrics do |t|
80
+ t.string :type
81
+ t.timestamp :interval
82
+ t.integer :application_id
83
+ t.string :event
84
+ t.integer :count
85
+ t.integer :avg_response_time
86
+ t.integer :error_count
87
+ t.timestamps
88
+ end
89
+ add_index :platform_application_usage_metrics, [:application_id, :interval], :name => "paumai"
90
+
91
+ create_table :platform_rollup_logs do |t|
92
+ t.timestamp :interval
93
+ t.timestamp :started_at
94
+ t.timestamp :finished_at
95
+ t.timestamps
96
+ end
97
+ add_index :platform_rollup_logs, :interval
98
+
99
+ create_table :platform_media do |t|
100
+ t.string :type
101
+ t.string :file_location
102
+ t.string :content_type
103
+ t.string :file_name
104
+ t.timestamps
105
+ end
106
+
107
+ create_table :platform_application_developers do |t|
108
+ t.integer :application_id
109
+ t.integer :developer_id
110
+ t.timestamps
111
+ end
112
+ add_index :platform_application_developers, :application_id
113
+ add_index :platform_application_developers, :developer_id
114
+
115
+ create_table :platform_oauth_tokens do |t|
116
+ t.string :type, :limit => 20
117
+ t.integer :user_id, :limit=>8
118
+ t.integer :application_id
119
+ t.string :token, :limit => 50
120
+ t.string :secret, :limit => 50
121
+ t.string :verifier, :limit => 20
122
+ t.string :callback_url
123
+ t.string :scope
124
+ t.timestamp :valid_to
125
+ t.timestamp :authorized_at, :invalidated_at
126
+ t.timestamps
127
+ end
128
+ add_index :platform_oauth_tokens, :token, :unique
129
+
130
+ create_table :platform_ratings do |t|
131
+ t.integer :user_id, :limit => 8, :null => false
132
+ t.string :object_type
133
+ t.integer :object_id
134
+ t.integer :value
135
+ t.text :comment
136
+ t.timestamps
137
+ end
138
+ add_index :platform_ratings, :user_id
139
+ add_index :platform_ratings, [:object_type, :object_id]
140
+
141
+ create_table :platform_categories do |t|
142
+ t.string :type
143
+ t.string :name
144
+ t.string :keyword
145
+ t.integer :position
146
+ t.date :enable_on
147
+ t.date :disable_on
148
+ t.integer :parent_id
149
+ t.timestamps
150
+ end
151
+ add_index :platform_categories, :parent_id
152
+
153
+ create_table :platform_application_categories do |t|
154
+ t.integer :category_id, :null => false
155
+ t.integer :application_id, :null => false
156
+ t.integer :position
157
+ t.boolean :featured
158
+ t.timestamps
159
+ end
160
+ add_index :platform_application_categories, :category_id, :name => "pacc"
161
+ add_index :platform_application_categories, [:category_id, :application_id], :name => "pacca"
162
+
163
+ create_table :platform_forum_topics do |t|
164
+ t.string :subject_type
165
+ t.integer :subject_id
166
+ t.integer :user_id, :null => false
167
+ t.text :topic, :null => false
168
+ t.timestamps
169
+ end
170
+ add_index :platform_forum_topics, [:subject_type, :subject_id], :name => "pftss"
171
+ add_index :platform_forum_topics, [:user_id], :name => "pftu"
172
+
173
+ create_table :platform_forum_messages do |t|
174
+ t.integer :forum_topic_id, :null => false
175
+ t.integer :user_id, :null => false
176
+ t.text :message, :null => false
177
+ t.timestamps
178
+ end
179
+ add_index :platform_forum_messages, [:forum_topic_id]
180
+ add_index :platform_forum_messages, [:user_id]
181
+
182
+ create_table :platform_permissions do |t|
183
+ t.string :keyword, :null => false
184
+ t.text :description, :null => false
185
+ t.timestamps
186
+ end
187
+ add_index :platform_permissions, [:keyword]
188
+
189
+ create_table :platform_application_permissions do |t|
190
+ t.integer :application_id
191
+ t.integer :permission_id
192
+ t.timestamps
193
+ end
194
+ add_index :platform_application_permissions, :application_id
195
+
196
+ create_table :platform_application_users do |t|
197
+ t.integer :application_id, :null => false
198
+ t.integer :user_id, :null => false
199
+ t.text :data
200
+ t.timestamps
201
+ end
202
+ add_index :platform_application_users, [:application_id]
203
+ add_index :platform_application_users, [:user_id]
204
+
205
+ create_table :platform_users do |t|
206
+ t.string :name
207
+ t.string :gender
208
+ t.string :email
209
+ t.string :password
210
+ t.string :mugshot
211
+ t.string :link
212
+ t.string :locale
213
+ t.timestamps
214
+ end
215
+ add_index :platform_users, [:email]
216
+ add_index :platform_users, [:email, :password]
217
+
218
+ create_table :platform_admins do |t|
219
+ t.integer :user_id
220
+ t.integer :level
221
+ t.timestamps
222
+ end
223
+ add_index :platform_admins, [:user_id]
224
+
225
+ create_table :platform_logged_exceptions do |t|
226
+ t.column :exception_class, :string
227
+ t.column :controller_name, :string
228
+ t.column :action_name, :string
229
+ t.column :server, :string
230
+ t.column :message, :text
231
+ t.column :backtrace, :text
232
+ t.column :environment, :text
233
+ t.column :request, :text
234
+ t.column :session, :text
235
+ t.column :cause, :binary
236
+ t.column :user_id, :integer
237
+ t.column :application_id, :integer
238
+ t.timestamps
239
+ end
240
+ end
241
+
242
+ def self.down
243
+ drop_table :platform_developers
244
+ drop_table :platform_applications
245
+ drop_table :platform_application_logs
246
+ drop_table :platform_application_metrics
247
+ drop_table :platform_rollup_logs
248
+ drop_table :platform_application_developers
249
+ drop_table :platform_oauth_tokens
250
+ drop_table :platform_ratings
251
+ drop_table :platform_categories
252
+ drop_table :platform_category_items
253
+ drop_table :platform_forum_topics
254
+ drop_table :platform_forum_messages
255
+ drop_table :platform_permissions
256
+ drop_table :platform_application_permissions
257
+ drop_table :platform_application_users
258
+ drop_table :platform_users
259
+ drop_table :platform_admins
260
+ drop_table :platform_logged_exceptions
261
+ end
262
+ end
@@ -0,0 +1,10 @@
1
+ class CreateBookmarks < ActiveRecord::Migration
2
+ def change
3
+ create_table :bookmarks do |t|
4
+ t.integer :user_id
5
+ t.string :title
6
+ t.string :url
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,683 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20111012055603) do
15
+
16
+ create_table "admins", :force => true do |t|
17
+ t.integer "user_id"
18
+ t.integer "level"
19
+ t.datetime "created_at"
20
+ t.datetime "updated_at"
21
+ end
22
+
23
+ add_index "admins", ["user_id"], :name => "index_admins_on_user_id"
24
+
25
+ create_table "bookmarks", :force => true do |t|
26
+ t.integer "user_id"
27
+ t.string "title"
28
+ t.string "url"
29
+ t.datetime "created_at"
30
+ t.datetime "updated_at"
31
+ end
32
+
33
+ create_table "platform_admins", :force => true do |t|
34
+ t.integer "user_id"
35
+ t.integer "level"
36
+ t.datetime "created_at"
37
+ t.datetime "updated_at"
38
+ end
39
+
40
+ add_index "platform_admins", ["user_id"], :name => "index_platform_admins_on_user_id"
41
+
42
+ create_table "platform_application_categories", :force => true do |t|
43
+ t.integer "category_id", :null => false
44
+ t.integer "application_id", :null => false
45
+ t.integer "position"
46
+ t.boolean "featured"
47
+ t.datetime "created_at"
48
+ t.datetime "updated_at"
49
+ end
50
+
51
+ add_index "platform_application_categories", ["category_id", "application_id"], :name => "pacca"
52
+ add_index "platform_application_categories", ["category_id"], :name => "pacc"
53
+
54
+ create_table "platform_application_developers", :force => true do |t|
55
+ t.integer "application_id"
56
+ t.integer "developer_id"
57
+ t.datetime "created_at"
58
+ t.datetime "updated_at"
59
+ end
60
+
61
+ add_index "platform_application_developers", ["application_id"], :name => "index_platform_application_developers_on_application_id"
62
+ add_index "platform_application_developers", ["developer_id"], :name => "index_platform_application_developers_on_developer_id"
63
+
64
+ create_table "platform_application_logs", :force => true do |t|
65
+ t.integer "application_id"
66
+ t.integer "user_id"
67
+ t.string "event"
68
+ t.string "controller"
69
+ t.string "action"
70
+ t.string "request_method"
71
+ t.text "data"
72
+ t.string "user_agent"
73
+ t.integer "duration"
74
+ t.string "host"
75
+ t.string "country"
76
+ t.string "ip"
77
+ t.datetime "created_at"
78
+ t.datetime "updated_at"
79
+ end
80
+
81
+ add_index "platform_application_logs", ["application_id", "created_at"], :name => "index_platform_application_logs_on_application_id_and_created_at"
82
+
83
+ create_table "platform_application_metrics", :force => true do |t|
84
+ t.string "type"
85
+ t.datetime "interval"
86
+ t.integer "application_id"
87
+ t.integer "active_user_count"
88
+ t.integer "new_user_count"
89
+ t.datetime "created_at"
90
+ t.datetime "updated_at"
91
+ end
92
+
93
+ add_index "platform_application_metrics", ["application_id", "interval"], :name => "pamai"
94
+
95
+ create_table "platform_application_permissions", :force => true do |t|
96
+ t.integer "application_id"
97
+ t.integer "permission_id"
98
+ t.datetime "created_at"
99
+ t.datetime "updated_at"
100
+ end
101
+
102
+ add_index "platform_application_permissions", ["application_id"], :name => "index_platform_application_permissions_on_application_id"
103
+
104
+ create_table "platform_application_usage_metrics", :force => true do |t|
105
+ t.string "type"
106
+ t.datetime "interval"
107
+ t.integer "application_id"
108
+ t.string "event"
109
+ t.integer "count"
110
+ t.integer "avg_response_time"
111
+ t.integer "error_count"
112
+ t.datetime "created_at"
113
+ t.datetime "updated_at"
114
+ end
115
+
116
+ add_index "platform_application_usage_metrics", ["application_id", "interval"], :name => "paumai"
117
+
118
+ create_table "platform_application_users", :force => true do |t|
119
+ t.integer "application_id", :null => false
120
+ t.integer "user_id", :null => false
121
+ t.text "data"
122
+ t.datetime "created_at"
123
+ t.datetime "updated_at"
124
+ end
125
+
126
+ add_index "platform_application_users", ["application_id"], :name => "index_platform_application_users_on_application_id"
127
+ add_index "platform_application_users", ["user_id"], :name => "index_platform_application_users_on_user_id"
128
+
129
+ create_table "platform_applications", :force => true do |t|
130
+ t.integer "developer_id"
131
+ t.string "name"
132
+ t.text "description"
133
+ t.string "state", :default => "new"
134
+ t.string "locale"
135
+ t.string "url"
136
+ t.string "site_domain"
137
+ t.string "support_url"
138
+ t.string "callback_url"
139
+ t.string "contact_email"
140
+ t.string "privacy_policy_url"
141
+ t.string "terms_of_service_url"
142
+ t.string "permissions"
143
+ t.string "key"
144
+ t.string "secret"
145
+ t.integer "icon_id"
146
+ t.integer "logo_id"
147
+ t.string "canvas_name"
148
+ t.string "canvas_url"
149
+ t.boolean "auto_resize"
150
+ t.boolean "auto_login"
151
+ t.string "mobile_application_type"
152
+ t.string "ios_bundle_id"
153
+ t.string "itunes_app_store_id"
154
+ t.string "android_key_hash"
155
+ t.integer "rank"
156
+ t.boolean "auto_signin"
157
+ t.string "deauthorize_callback_url"
158
+ t.string "version"
159
+ t.string "api_version"
160
+ t.integer "parent_id"
161
+ t.datetime "created_at"
162
+ t.datetime "updated_at"
163
+ end
164
+
165
+ add_index "platform_applications", ["developer_id"], :name => "index_platform_applications_on_developer_id"
166
+ add_index "platform_applications", ["key"], :name => "index_platform_applications_on_key", :unique => true
167
+ add_index "platform_applications", ["parent_id"], :name => "index_platform_applications_on_parent_id"
168
+
169
+ create_table "platform_categories", :force => true do |t|
170
+ t.string "type"
171
+ t.string "name"
172
+ t.string "keyword"
173
+ t.integer "position"
174
+ t.date "enable_on"
175
+ t.date "disable_on"
176
+ t.integer "parent_id"
177
+ t.datetime "created_at"
178
+ t.datetime "updated_at"
179
+ end
180
+
181
+ add_index "platform_categories", ["parent_id"], :name => "index_platform_categories_on_parent_id"
182
+
183
+ create_table "platform_developers", :force => true do |t|
184
+ t.integer "user_id", :limit => 8, :null => false
185
+ t.string "name", :null => false
186
+ t.text "about"
187
+ t.string "url"
188
+ t.string "email"
189
+ t.string "phone"
190
+ t.datetime "created_at"
191
+ t.datetime "updated_at"
192
+ end
193
+
194
+ add_index "platform_developers", ["user_id"], :name => "index_platform_developers_on_user_id"
195
+
196
+ create_table "platform_forum_messages", :force => true do |t|
197
+ t.integer "forum_topic_id", :null => false
198
+ t.integer "user_id", :null => false
199
+ t.text "message", :null => false
200
+ t.datetime "created_at"
201
+ t.datetime "updated_at"
202
+ end
203
+
204
+ add_index "platform_forum_messages", ["forum_topic_id"], :name => "index_platform_forum_messages_on_forum_topic_id"
205
+ add_index "platform_forum_messages", ["user_id"], :name => "index_platform_forum_messages_on_user_id"
206
+
207
+ create_table "platform_forum_topics", :force => true do |t|
208
+ t.string "subject_type"
209
+ t.integer "subject_id"
210
+ t.integer "user_id", :null => false
211
+ t.text "topic", :null => false
212
+ t.datetime "created_at"
213
+ t.datetime "updated_at"
214
+ end
215
+
216
+ add_index "platform_forum_topics", ["subject_type", "subject_id"], :name => "pftss"
217
+ add_index "platform_forum_topics", ["user_id"], :name => "pftu"
218
+
219
+ create_table "platform_logged_exceptions", :force => true do |t|
220
+ t.string "exception_class"
221
+ t.string "controller_name"
222
+ t.string "action_name"
223
+ t.string "server"
224
+ t.text "message"
225
+ t.text "backtrace"
226
+ t.text "environment"
227
+ t.text "request"
228
+ t.text "session"
229
+ t.binary "cause"
230
+ t.integer "user_id"
231
+ t.integer "application_id"
232
+ t.datetime "created_at"
233
+ t.datetime "updated_at"
234
+ end
235
+
236
+ create_table "platform_media", :force => true do |t|
237
+ t.string "type"
238
+ t.string "file_location"
239
+ t.string "content_type"
240
+ t.string "file_name"
241
+ t.datetime "created_at"
242
+ t.datetime "updated_at"
243
+ end
244
+
245
+ create_table "platform_oauth_tokens", :force => true do |t|
246
+ t.string "type", :limit => 20
247
+ t.integer "user_id", :limit => 8
248
+ t.integer "application_id"
249
+ t.string "token", :limit => 50
250
+ t.string "secret", :limit => 50
251
+ t.string "verifier", :limit => 20
252
+ t.string "callback_url"
253
+ t.string "scope"
254
+ t.datetime "valid_to"
255
+ t.datetime "authorized_at"
256
+ t.datetime "invalidated_at"
257
+ t.datetime "created_at"
258
+ t.datetime "updated_at"
259
+ end
260
+
261
+ add_index "platform_oauth_tokens", ["token"], :name => "index_platform_oauth_tokens_on_token", :unique => true
262
+
263
+ create_table "platform_permissions", :force => true do |t|
264
+ t.string "keyword", :null => false
265
+ t.text "description", :null => false
266
+ t.datetime "created_at"
267
+ t.datetime "updated_at"
268
+ end
269
+
270
+ add_index "platform_permissions", ["keyword"], :name => "index_platform_permissions_on_keyword"
271
+
272
+ create_table "platform_ratings", :force => true do |t|
273
+ t.integer "user_id", :limit => 8, :null => false
274
+ t.string "object_type"
275
+ t.integer "object_id"
276
+ t.integer "value"
277
+ t.text "comment"
278
+ t.datetime "created_at"
279
+ t.datetime "updated_at"
280
+ end
281
+
282
+ add_index "platform_ratings", ["object_type", "object_id"], :name => "index_platform_ratings_on_object_type_and_object_id"
283
+ add_index "platform_ratings", ["user_id"], :name => "index_platform_ratings_on_user_id"
284
+
285
+ create_table "platform_rollup_logs", :force => true do |t|
286
+ t.datetime "interval"
287
+ t.datetime "started_at"
288
+ t.datetime "finished_at"
289
+ t.datetime "created_at"
290
+ t.datetime "updated_at"
291
+ end
292
+
293
+ add_index "platform_rollup_logs", ["interval"], :name => "index_platform_rollup_logs_on_interval"
294
+
295
+ create_table "platform_users", :force => true do |t|
296
+ t.string "name"
297
+ t.string "gender"
298
+ t.string "email"
299
+ t.string "password"
300
+ t.string "mugshot"
301
+ t.string "link"
302
+ t.string "locale"
303
+ t.datetime "created_at"
304
+ t.datetime "updated_at"
305
+ end
306
+
307
+ add_index "platform_users", ["email", "password"], :name => "index_platform_users_on_email_and_password"
308
+ add_index "platform_users", ["email"], :name => "index_platform_users_on_email"
309
+
310
+ create_table "tr8n_glossary", :force => true do |t|
311
+ t.string "keyword"
312
+ t.text "description"
313
+ t.datetime "created_at"
314
+ t.datetime "updated_at"
315
+ end
316
+
317
+ add_index "tr8n_glossary", ["keyword"], :name => "index_tr8n_glossary_on_keyword"
318
+
319
+ create_table "tr8n_ip_locations", :force => true do |t|
320
+ t.integer "low", :limit => 8
321
+ t.integer "high", :limit => 8
322
+ t.string "registry", :limit => 20
323
+ t.date "assigned"
324
+ t.string "ctry", :limit => 2
325
+ t.string "cntry", :limit => 3
326
+ t.string "country", :limit => 80
327
+ t.datetime "created_at"
328
+ t.datetime "updated_at"
329
+ end
330
+
331
+ add_index "tr8n_ip_locations", ["high"], :name => "index_tr8n_ip_locations_on_high"
332
+ add_index "tr8n_ip_locations", ["low"], :name => "index_tr8n_ip_locations_on_low"
333
+
334
+ create_table "tr8n_language_case_rules", :force => true do |t|
335
+ t.integer "language_case_id", :null => false
336
+ t.integer "language_id"
337
+ t.integer "translator_id"
338
+ t.text "definition", :null => false
339
+ t.integer "position"
340
+ t.datetime "created_at"
341
+ t.datetime "updated_at"
342
+ end
343
+
344
+ add_index "tr8n_language_case_rules", ["language_case_id"], :name => "tr8n_lcr_case_id"
345
+ add_index "tr8n_language_case_rules", ["language_id"], :name => "tr8n_lcr_lang_id"
346
+ add_index "tr8n_language_case_rules", ["translator_id"], :name => "tr8n_lcr_translator_id"
347
+
348
+ create_table "tr8n_language_case_value_maps", :force => true do |t|
349
+ t.string "keyword", :null => false
350
+ t.integer "language_id", :null => false
351
+ t.integer "translator_id"
352
+ t.text "map"
353
+ t.boolean "reported"
354
+ t.datetime "created_at"
355
+ t.datetime "updated_at"
356
+ end
357
+
358
+ add_index "tr8n_language_case_value_maps", ["keyword", "language_id"], :name => "index_tr8n_language_case_value_maps_on_keyword_and_language_id"
359
+ add_index "tr8n_language_case_value_maps", ["translator_id"], :name => "index_tr8n_language_case_value_maps_on_translator_id"
360
+
361
+ create_table "tr8n_language_cases", :force => true do |t|
362
+ t.integer "language_id", :null => false
363
+ t.integer "translator_id"
364
+ t.string "keyword"
365
+ t.string "latin_name"
366
+ t.string "native_name"
367
+ t.text "description"
368
+ t.string "application"
369
+ t.datetime "created_at"
370
+ t.datetime "updated_at"
371
+ end
372
+
373
+ add_index "tr8n_language_cases", ["language_id", "keyword"], :name => "index_tr8n_language_cases_on_language_id_and_keyword"
374
+ add_index "tr8n_language_cases", ["language_id", "translator_id"], :name => "index_tr8n_language_cases_on_language_id_and_translator_id"
375
+ add_index "tr8n_language_cases", ["language_id"], :name => "index_tr8n_language_cases_on_language_id"
376
+
377
+ create_table "tr8n_language_forum_abuse_reports", :force => true do |t|
378
+ t.integer "language_id", :null => false
379
+ t.integer "translator_id", :null => false
380
+ t.integer "language_forum_message_id", :null => false
381
+ t.string "reason"
382
+ t.datetime "created_at"
383
+ t.datetime "updated_at"
384
+ end
385
+
386
+ add_index "tr8n_language_forum_abuse_reports", ["language_forum_message_id"], :name => "tr8n_forum_reports_message_id"
387
+ add_index "tr8n_language_forum_abuse_reports", ["language_id", "translator_id"], :name => "tr8n_forum_reports_lang_id_translator_id"
388
+ add_index "tr8n_language_forum_abuse_reports", ["language_id"], :name => "tr8n_forum_reports_lang_id"
389
+
390
+ create_table "tr8n_language_forum_messages", :force => true do |t|
391
+ t.integer "language_id", :null => false
392
+ t.integer "language_forum_topic_id", :null => false
393
+ t.integer "translator_id", :null => false
394
+ t.text "message", :null => false
395
+ t.datetime "created_at"
396
+ t.datetime "updated_at"
397
+ end
398
+
399
+ add_index "tr8n_language_forum_messages", ["language_id", "language_forum_topic_id"], :name => "tr8n_forum_msgs_lang_id_topic_id"
400
+ add_index "tr8n_language_forum_messages", ["language_id"], :name => "tr8n_forum_msgs_lang_id"
401
+ add_index "tr8n_language_forum_messages", ["translator_id"], :name => "tr8n_forums_msgs_translator_id"
402
+
403
+ create_table "tr8n_language_forum_topics", :force => true do |t|
404
+ t.integer "translator_id", :null => false
405
+ t.integer "language_id"
406
+ t.text "topic", :null => false
407
+ t.datetime "created_at"
408
+ t.datetime "updated_at"
409
+ end
410
+
411
+ add_index "tr8n_language_forum_topics", ["language_id"], :name => "tr8n_forum_topics_lang_id"
412
+ add_index "tr8n_language_forum_topics", ["translator_id"], :name => "tr8n_forum_topics_translator_id"
413
+
414
+ create_table "tr8n_language_metrics", :force => true do |t|
415
+ t.string "type"
416
+ t.integer "language_id", :null => false
417
+ t.date "metric_date"
418
+ t.integer "user_count", :default => 0
419
+ t.integer "translator_count", :default => 0
420
+ t.integer "translation_count", :default => 0
421
+ t.integer "key_count", :default => 0
422
+ t.integer "locked_key_count", :default => 0
423
+ t.integer "translated_key_count", :default => 0
424
+ t.datetime "created_at"
425
+ t.datetime "updated_at"
426
+ end
427
+
428
+ add_index "tr8n_language_metrics", ["created_at"], :name => "index_tr8n_language_metrics_on_created_at"
429
+ add_index "tr8n_language_metrics", ["language_id"], :name => "index_tr8n_language_metrics_on_language_id"
430
+
431
+ create_table "tr8n_language_rules", :force => true do |t|
432
+ t.integer "language_id", :null => false
433
+ t.integer "translator_id"
434
+ t.string "type"
435
+ t.text "definition"
436
+ t.datetime "created_at"
437
+ t.datetime "updated_at"
438
+ end
439
+
440
+ add_index "tr8n_language_rules", ["language_id", "translator_id"], :name => "index_tr8n_language_rules_on_language_id_and_translator_id"
441
+ add_index "tr8n_language_rules", ["language_id"], :name => "index_tr8n_language_rules_on_language_id"
442
+
443
+ create_table "tr8n_language_users", :force => true do |t|
444
+ t.integer "language_id", :null => false
445
+ t.integer "user_id", :null => false
446
+ t.integer "translator_id"
447
+ t.boolean "manager", :default => false
448
+ t.datetime "created_at"
449
+ t.datetime "updated_at"
450
+ end
451
+
452
+ add_index "tr8n_language_users", ["created_at"], :name => "index_tr8n_language_users_on_created_at"
453
+ add_index "tr8n_language_users", ["language_id", "translator_id"], :name => "index_tr8n_language_users_on_language_id_and_translator_id"
454
+ add_index "tr8n_language_users", ["language_id", "user_id"], :name => "index_tr8n_language_users_on_language_id_and_user_id"
455
+ add_index "tr8n_language_users", ["updated_at"], :name => "index_tr8n_language_users_on_updated_at"
456
+ add_index "tr8n_language_users", ["user_id"], :name => "index_tr8n_language_users_on_user_id"
457
+
458
+ create_table "tr8n_languages", :force => true do |t|
459
+ t.string "locale", :null => false
460
+ t.string "english_name", :null => false
461
+ t.string "native_name"
462
+ t.boolean "enabled"
463
+ t.boolean "right_to_left"
464
+ t.integer "completeness"
465
+ t.integer "fallback_language_id"
466
+ t.text "curse_words"
467
+ t.integer "featured_index", :default => 0
468
+ t.string "google_key"
469
+ t.string "facebook_key"
470
+ t.datetime "created_at"
471
+ t.datetime "updated_at"
472
+ end
473
+
474
+ add_index "tr8n_languages", ["locale"], :name => "index_tr8n_languages_on_locale"
475
+
476
+ create_table "tr8n_translation_domains", :force => true do |t|
477
+ t.string "name"
478
+ t.string "description"
479
+ t.integer "source_count", :default => 0
480
+ t.datetime "created_at"
481
+ t.datetime "updated_at"
482
+ end
483
+
484
+ add_index "tr8n_translation_domains", ["name"], :name => "index_tr8n_translation_domains_on_name", :unique => true
485
+
486
+ create_table "tr8n_translation_key_comments", :force => true do |t|
487
+ t.integer "language_id", :null => false
488
+ t.integer "translation_key_id", :null => false
489
+ t.integer "translator_id", :null => false
490
+ t.text "message", :null => false
491
+ t.datetime "created_at"
492
+ t.datetime "updated_at"
493
+ end
494
+
495
+ add_index "tr8n_translation_key_comments", ["language_id", "translation_key_id"], :name => "tr8n_tkey_msgs_lang_id_tkey_id"
496
+ add_index "tr8n_translation_key_comments", ["language_id"], :name => "tr8n_tkey_msgs_lang_id"
497
+ add_index "tr8n_translation_key_comments", ["translator_id"], :name => "tr8n_tkey_msgs_translator_id"
498
+
499
+ create_table "tr8n_translation_key_locks", :force => true do |t|
500
+ t.integer "translation_key_id", :null => false
501
+ t.integer "language_id", :null => false
502
+ t.integer "translator_id"
503
+ t.boolean "locked", :default => false
504
+ t.datetime "created_at"
505
+ t.datetime "updated_at"
506
+ end
507
+
508
+ add_index "tr8n_translation_key_locks", ["translation_key_id", "language_id"], :name => "tr8n_locks_key_id_lang_id"
509
+
510
+ create_table "tr8n_translation_key_sources", :force => true do |t|
511
+ t.integer "translation_key_id", :null => false
512
+ t.integer "translation_source_id", :null => false
513
+ t.text "details"
514
+ t.datetime "created_at"
515
+ t.datetime "updated_at"
516
+ end
517
+
518
+ add_index "tr8n_translation_key_sources", ["translation_key_id"], :name => "tr8n_trans_keys_key_id"
519
+ add_index "tr8n_translation_key_sources", ["translation_source_id"], :name => "tr8n_trans_keys_source_id"
520
+
521
+ create_table "tr8n_translation_keys", :force => true do |t|
522
+ t.string "type"
523
+ t.string "key", :null => false
524
+ t.text "label", :null => false
525
+ t.text "description"
526
+ t.datetime "verified_at"
527
+ t.integer "translation_count"
528
+ t.boolean "admin"
529
+ t.string "locale"
530
+ t.integer "level", :default => 0
531
+ t.datetime "created_at"
532
+ t.datetime "updated_at"
533
+ end
534
+
535
+ add_index "tr8n_translation_keys", ["key"], :name => "index_tr8n_translation_keys_on_key", :unique => true
536
+
537
+ create_table "tr8n_translation_sources", :force => true do |t|
538
+ t.string "source"
539
+ t.integer "translation_domain_id"
540
+ t.datetime "created_at"
541
+ t.datetime "updated_at"
542
+ end
543
+
544
+ add_index "tr8n_translation_sources", ["source"], :name => "tr8n_sources_source"
545
+
546
+ create_table "tr8n_translation_votes", :force => true do |t|
547
+ t.integer "translation_id", :null => false
548
+ t.integer "translator_id", :null => false
549
+ t.integer "vote", :null => false
550
+ t.datetime "created_at"
551
+ t.datetime "updated_at"
552
+ end
553
+
554
+ add_index "tr8n_translation_votes", ["translation_id", "translator_id"], :name => "tr8n_trans_votes_trans_id_translator_id"
555
+ add_index "tr8n_translation_votes", ["translator_id"], :name => "tr8n_trans_votes_translator_id"
556
+
557
+ create_table "tr8n_translations", :force => true do |t|
558
+ t.integer "translation_key_id", :null => false
559
+ t.integer "language_id", :null => false
560
+ t.integer "translator_id", :null => false
561
+ t.text "label", :null => false
562
+ t.integer "rank", :default => 0
563
+ t.integer "approved_by_id", :limit => 8
564
+ t.text "rules"
565
+ t.datetime "created_at"
566
+ t.datetime "updated_at"
567
+ end
568
+
569
+ add_index "tr8n_translations", ["created_at"], :name => "tr8n_trans_created_at"
570
+ add_index "tr8n_translations", ["translation_key_id", "translator_id", "language_id"], :name => "tr8n_trans_key_id_translator_id_lang_id"
571
+ add_index "tr8n_translations", ["translator_id"], :name => "r8n_trans_translator_id"
572
+
573
+ create_table "tr8n_translator_following", :force => true do |t|
574
+ t.integer "translator_id"
575
+ t.integer "object_id"
576
+ t.string "object_type"
577
+ t.datetime "created_at"
578
+ t.datetime "updated_at"
579
+ end
580
+
581
+ add_index "tr8n_translator_following", ["translator_id"], :name => "index_tr8n_translator_following_on_translator_id"
582
+
583
+ create_table "tr8n_translator_logs", :force => true do |t|
584
+ t.integer "translator_id"
585
+ t.integer "user_id", :limit => 8
586
+ t.string "action"
587
+ t.integer "action_level"
588
+ t.string "reason"
589
+ t.string "reference"
590
+ t.datetime "created_at"
591
+ t.datetime "updated_at"
592
+ end
593
+
594
+ add_index "tr8n_translator_logs", ["created_at"], :name => "index_tr8n_translator_logs_on_created_at"
595
+ add_index "tr8n_translator_logs", ["translator_id"], :name => "index_tr8n_translator_logs_on_translator_id"
596
+ add_index "tr8n_translator_logs", ["user_id"], :name => "index_tr8n_translator_logs_on_user_id"
597
+
598
+ create_table "tr8n_translator_metrics", :force => true do |t|
599
+ t.integer "translator_id", :null => false
600
+ t.integer "language_id"
601
+ t.integer "total_translations", :default => 0
602
+ t.integer "total_votes", :default => 0
603
+ t.integer "positive_votes", :default => 0
604
+ t.integer "negative_votes", :default => 0
605
+ t.integer "accepted_translations", :default => 0
606
+ t.integer "rejected_translations", :default => 0
607
+ t.datetime "created_at"
608
+ t.datetime "updated_at"
609
+ end
610
+
611
+ add_index "tr8n_translator_metrics", ["created_at"], :name => "index_tr8n_translator_metrics_on_created_at"
612
+ add_index "tr8n_translator_metrics", ["translator_id", "language_id"], :name => "index_tr8n_translator_metrics_on_translator_id_and_language_id"
613
+ add_index "tr8n_translator_metrics", ["translator_id"], :name => "index_tr8n_translator_metrics_on_translator_id"
614
+
615
+ create_table "tr8n_translator_reports", :force => true do |t|
616
+ t.integer "translator_id"
617
+ t.string "state"
618
+ t.integer "object_id"
619
+ t.string "object_type"
620
+ t.string "reason"
621
+ t.text "comment"
622
+ t.datetime "created_at"
623
+ t.datetime "updated_at"
624
+ end
625
+
626
+ add_index "tr8n_translator_reports", ["translator_id"], :name => "index_tr8n_translator_reports_on_translator_id"
627
+
628
+ create_table "tr8n_translators", :force => true do |t|
629
+ t.integer "user_id", :null => false
630
+ t.boolean "inline_mode", :default => false
631
+ t.boolean "blocked", :default => false
632
+ t.boolean "reported", :default => false
633
+ t.integer "fallback_language_id"
634
+ t.integer "rank", :default => 0
635
+ t.string "name"
636
+ t.string "gender"
637
+ t.string "email"
638
+ t.string "password"
639
+ t.string "mugshot"
640
+ t.string "link"
641
+ t.string "locale"
642
+ t.integer "level", :default => 0
643
+ t.integer "manager"
644
+ t.string "last_ip"
645
+ t.string "country_code"
646
+ t.datetime "created_at"
647
+ t.datetime "updated_at"
648
+ end
649
+
650
+ add_index "tr8n_translators", ["created_at"], :name => "index_tr8n_translators_on_created_at"
651
+ add_index "tr8n_translators", ["email", "password"], :name => "index_tr8n_translators_on_email_and_password"
652
+ add_index "tr8n_translators", ["email"], :name => "index_tr8n_translators_on_email"
653
+ add_index "tr8n_translators", ["user_id"], :name => "index_tr8n_translators_on_user_id"
654
+
655
+ create_table "users", :force => true do |t|
656
+ t.string "email"
657
+ t.string "password"
658
+ t.string "first_name"
659
+ t.string "last_name"
660
+ t.string "gender"
661
+ t.string "mugshot"
662
+ t.string "locale"
663
+ t.string "link"
664
+ t.datetime "created_at"
665
+ t.datetime "updated_at"
666
+ end
667
+
668
+ add_index "users", ["email", "password"], :name => "index_users_on_email_and_password"
669
+ add_index "users", ["email"], :name => "index_users_on_email"
670
+
671
+ create_table "will_filter_filters", :force => true do |t|
672
+ t.string "type"
673
+ t.string "name"
674
+ t.text "data"
675
+ t.integer "user_id"
676
+ t.string "model_class_name"
677
+ t.datetime "created_at"
678
+ t.datetime "updated_at"
679
+ end
680
+
681
+ add_index "will_filter_filters", ["user_id"], :name => "index_will_filter_filters_on_user_id"
682
+
683
+ end