guara 0.0.1.rc

Sign up to get free protection for your applications and to get access to all the features.
Files changed (512) hide show
  1. data/.gitignore +23 -0
  2. data/.rspec +2 -0
  3. data/.travis.yml +33 -0
  4. data/Gemfile +82 -0
  5. data/Gemfile.lock +323 -0
  6. data/Guardfile +32 -0
  7. data/MIT-LICENSE +20 -0
  8. data/README.md +8 -0
  9. data/Rakefile +7 -0
  10. data/app/admin/business_activities.rb +3 -0
  11. data/app/admin/business_departments.rb +3 -0
  12. data/app/admin/business_segments.rb +13 -0
  13. data/app/admin/cities.rb +3 -0
  14. data/app/admin/company_businesses.rb +3 -0
  15. data/app/admin/dashboard.rb +39 -0
  16. data/app/admin/districts.rb +3 -0
  17. data/app/admin/states.rb +3 -0
  18. data/app/admin/task_types.rb +3 -0
  19. data/app/admin/user_groups.rb +3 -0
  20. data/app/admin/users.rb +3 -0
  21. data/app/assets/images/close.gif +0 -0
  22. data/app/assets/images/custom/logo.png +0 -0
  23. data/app/assets/images/custom/nav_logo.png +0 -0
  24. data/app/assets/images/custom/nav_logo.psd +0 -0
  25. data/app/assets/images/rails.png +0 -0
  26. data/app/assets/javascripts/active_admin.js +5 -0
  27. data/app/assets/javascripts/application.js +97 -0
  28. data/app/assets/javascripts/business_departments.js.coffee +3 -0
  29. data/app/assets/javascripts/company_businesses.js.coffee +3 -0
  30. data/app/assets/javascripts/crm.js.coffee +14 -0
  31. data/app/assets/javascripts/fcbk.js +556 -0
  32. data/app/assets/javascripts/jquery-ui-timepicker-addon.js +1326 -0
  33. data/app/assets/javascripts/jquery.mask.1.3.js +7 -0
  34. data/app/assets/javascripts/jquery.multiselect.filter.xjs +173 -0
  35. data/app/assets/javascripts/jquery.multiselect.xjs +668 -0
  36. data/app/assets/javascripts/system_task_status.js.coffee +3 -0
  37. data/app/assets/javascripts/tests/ajaxes.js.coffee +3 -0
  38. data/app/assets/stylesheets/abilities.css.scss +6 -0
  39. data/app/assets/stylesheets/active_admin.css.scss +65 -0
  40. data/app/assets/stylesheets/application.css +19 -0
  41. data/app/assets/stylesheets/business_departments.css.scss +3 -0
  42. data/app/assets/stylesheets/company_businesses.css.scss +3 -0
  43. data/app/assets/stylesheets/custom.css.scss +322 -0
  44. data/app/assets/stylesheets/customer.scss +7 -0
  45. data/app/assets/stylesheets/fcbk.css +165 -0
  46. data/app/assets/stylesheets/guara.css.scss +159 -0
  47. data/app/assets/stylesheets/jquery-ui.css +567 -0
  48. data/app/assets/stylesheets/jquery_bootstrap.css.scss +92 -0
  49. data/app/assets/stylesheets/jquery_multiselect_filter.xcss +3 -0
  50. data/app/assets/stylesheets/scaffolds.css.scss +42 -0
  51. data/app/assets/stylesheets/users.css.scss +10 -0
  52. data/app/controllers/abilities_controller.rb +37 -0
  53. data/app/controllers/application_controller.rb +12 -0
  54. data/app/controllers/business_activities_controller.rb +87 -0
  55. data/app/controllers/business_departments_controller.rb +90 -0
  56. data/app/controllers/business_segments_controller.rb +88 -0
  57. data/app/controllers/company_businesses_controller.rb +46 -0
  58. data/app/controllers/contacts_controller.rb +105 -0
  59. data/app/controllers/customers_controller.rb +117 -0
  60. data/app/controllers/microposts_controller.rb +31 -0
  61. data/app/controllers/sessions_controller.rb +32 -0
  62. data/app/controllers/static_pages_controller.rb +23 -0
  63. data/app/controllers/system_task_status_controller.rb +84 -0
  64. data/app/controllers/task_feedbacks_controller.rb +6 -0
  65. data/app/controllers/task_types_controller.rb +85 -0
  66. data/app/controllers/tasks_controller.rb +107 -0
  67. data/app/controllers/tests/ajaxes_controller.rb +115 -0
  68. data/app/controllers/tests/lab_ajax_controller.rb +27 -0
  69. data/app/controllers/users_controller.rb +62 -0
  70. data/app/helpers/ability_helper.rb +15 -0
  71. data/app/helpers/application_helper.rb +32 -0
  72. data/app/helpers/business_activities_helper.rb +2 -0
  73. data/app/helpers/business_departments_helper.rb +2 -0
  74. data/app/helpers/business_segments_helper.rb +2 -0
  75. data/app/helpers/company_businesses_helper.rb +2 -0
  76. data/app/helpers/contacts_helper.rb +2 -0
  77. data/app/helpers/customers_helper.rb +23 -0
  78. data/app/helpers/email_helper.rb +8 -0
  79. data/app/helpers/form_ajax_helper.rb +8 -0
  80. data/app/helpers/guara_views_helper.rb +38 -0
  81. data/app/helpers/locale_helper.rb +24 -0
  82. data/app/helpers/menu_helper.rb +55 -0
  83. data/app/helpers/sessions_helper.rb +56 -0
  84. data/app/helpers/tasks_helper.rb +20 -0
  85. data/app/helpers/tests/ajaxes_helper.rb +2 -0
  86. data/app/helpers/user_abilities_helper.rb +12 -0
  87. data/app/helpers/users_helper.rb +29 -0
  88. data/app/mailers/.gitkeep +0 -0
  89. data/app/models/.gitkeep +0 -0
  90. data/app/models/ability.rb +52 -0
  91. data/app/models/address.rb +7 -0
  92. data/app/models/business_activity.rb +5 -0
  93. data/app/models/business_department.rb +3 -0
  94. data/app/models/business_segment.rb +5 -0
  95. data/app/models/city.rb +7 -0
  96. data/app/models/company_business.rb +6 -0
  97. data/app/models/contact.rb +69 -0
  98. data/app/models/customer.rb +117 -0
  99. data/app/models/customer_activity.rb +9 -0
  100. data/app/models/customer_financial.rb +10 -0
  101. data/app/models/customer_has_customers.rb +7 -0
  102. data/app/models/customer_pf.rb +13 -0
  103. data/app/models/customer_pj.rb +71 -0
  104. data/app/models/customer_pj_has_customers_pj.rb +7 -0
  105. data/app/models/customer_product.rb +3 -0
  106. data/app/models/customer_segment.rb +9 -0
  107. data/app/models/district.rb +6 -0
  108. data/app/models/email.rb +7 -0
  109. data/app/models/micropost.rb +10 -0
  110. data/app/models/relationship.rb +9 -0
  111. data/app/models/search.rb +17 -0
  112. data/app/models/state.rb +3 -0
  113. data/app/models/system_ability.rb +16 -0
  114. data/app/models/system_module.rb +16 -0
  115. data/app/models/system_task_resolution.rb +26 -0
  116. data/app/models/system_task_status.rb +19 -0
  117. data/app/models/task.rb +76 -0
  118. data/app/models/task_feedback.rb +11 -0
  119. data/app/models/task_type.rb +12 -0
  120. data/app/models/tests.rb +5 -0
  121. data/app/models/tests/ajax.rb +3 -0
  122. data/app/models/user.rb +126 -0
  123. data/app/models/user_ability.rb +23 -0
  124. data/app/models/user_group.rb +9 -0
  125. data/app/models/user_type.rb +9 -0
  126. data/app/models/users_has_groups.rb +9 -0
  127. data/app/validators/customer_cnpj_validator.rb +14 -0
  128. data/app/validators/email_validator.rb +21 -0
  129. data/app/views/abilities/index.html.erb +25 -0
  130. data/app/views/active_extend/_one_to_many_inputs.html.erb +7 -0
  131. data/app/views/active_extend/_one_to_many_inputs_fields.html.erb +10 -0
  132. data/app/views/active_extend/_one_to_many_inputs_with_glyph.html.erb +21 -0
  133. data/app/views/business_activities/_business_activity.html.erb +0 -0
  134. data/app/views/business_activities/_form.html.erb +25 -0
  135. data/app/views/business_activities/edit.html.erb +6 -0
  136. data/app/views/business_activities/index.html.erb +33 -0
  137. data/app/views/business_activities/new.html.erb +5 -0
  138. data/app/views/business_activities/show.html.erb +15 -0
  139. data/app/views/business_departments/_form.html.erb +10 -0
  140. data/app/views/business_departments/edit.html.erb +6 -0
  141. data/app/views/business_departments/index.html.erb +33 -0
  142. data/app/views/business_departments/new.html.erb +5 -0
  143. data/app/views/business_departments/show.html.erb +15 -0
  144. data/app/views/business_segments/_business_segment.html.erb +8 -0
  145. data/app/views/business_segments/_form.html.erb +25 -0
  146. data/app/views/business_segments/edit.html.erb +6 -0
  147. data/app/views/business_segments/index.html.erb +33 -0
  148. data/app/views/business_segments/new.html.erb +5 -0
  149. data/app/views/business_segments/show.html.erb +15 -0
  150. data/app/views/company_businesses/_form.html.erb +10 -0
  151. data/app/views/company_businesses/edit.html.erb +6 -0
  152. data/app/views/company_businesses/index.html.erb +25 -0
  153. data/app/views/company_businesses/new.html.erb +5 -0
  154. data/app/views/company_businesses/show.html.erb +15 -0
  155. data/app/views/contacts/_form.html.erb +53 -0
  156. data/app/views/contacts/_header.html.erb +3 -0
  157. data/app/views/contacts/_list.html.erb +46 -0
  158. data/app/views/contacts/_side_panel.html.erb +61 -0
  159. data/app/views/contacts/edit.html.erb +6 -0
  160. data/app/views/contacts/index.html.erb +72 -0
  161. data/app/views/contacts/new.html.erb +5 -0
  162. data/app/views/contacts/show.html.erb +52 -0
  163. data/app/views/customers/_businesses_done.html.erb +18 -0
  164. data/app/views/customers/_customer_segment.html.erb +9 -0
  165. data/app/views/customers/_form.html.erb +177 -0
  166. data/app/views/customers/_form_search.html.erb +119 -0
  167. data/app/views/customers/_modules.html.erb +6 -0
  168. data/app/views/customers/_navbar.html.erb +23 -0
  169. data/app/views/customers/_segment.html.erb +10 -0
  170. data/app/views/customers/edit.html.erb +8 -0
  171. data/app/views/customers/index.html.erb +46 -0
  172. data/app/views/customers/new.pj.html.erb +4 -0
  173. data/app/views/customers/show.pj.html.erb +200 -0
  174. data/app/views/devise/confirmations/new.html.erb +12 -0
  175. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  176. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  177. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  178. data/app/views/devise/passwords/edit.html.erb +16 -0
  179. data/app/views/devise/passwords/new.html.erb +12 -0
  180. data/app/views/devise/registrations/edit.html.erb +25 -0
  181. data/app/views/devise/registrations/new.html.erb +18 -0
  182. data/app/views/devise/sessions/new.html.erb +24 -0
  183. data/app/views/devise/shared/_links.erb +25 -0
  184. data/app/views/devise/unlocks/new.html.erb +12 -0
  185. data/app/views/emails/_email_fields.html.erb +1 -0
  186. data/app/views/layouts/_active_admin_footer.html.erb +4 -0
  187. data/app/views/layouts/_active_admin_header.html.erb +5 -0
  188. data/app/views/layouts/_footer.html.erb +12 -0
  189. data/app/views/layouts/_header.html.erb +51 -0
  190. data/app/views/layouts/_shim.html.erb +3 -0
  191. data/app/views/layouts/active_admin.html.arb +1 -0
  192. data/app/views/layouts/application.html.erb +24 -0
  193. data/app/views/microposts/_micropost.html.erb +11 -0
  194. data/app/views/sessions/new.html.erb +18 -0
  195. data/app/views/shared/_calendar.html.erb +17 -0
  196. data/app/views/shared/_error_messages.html.erb +13 -0
  197. data/app/views/shared/_feed.html.erb +10 -0
  198. data/app/views/shared/_feed_item.html.erb +15 -0
  199. data/app/views/shared/_micropost_form.html.erb +7 -0
  200. data/app/views/shared/_multi_selection.html.erb +16 -0
  201. data/app/views/shared/_multi_selection.html_checkbox.erb +11 -0
  202. data/app/views/shared/_multi_selection_autocomple.html.erb +5 -0
  203. data/app/views/shared/_notifies.html.erb +17 -0
  204. data/app/views/shared/_user_info.html.erb +14 -0
  205. data/app/views/static_pages/about.html.erb +5 -0
  206. data/app/views/static_pages/contact.html.erb +5 -0
  207. data/app/views/static_pages/help.html.erb +5 -0
  208. data/app/views/static_pages/home.html.erb +37 -0
  209. data/app/views/static_pages/news.html.erb +2 -0
  210. data/app/views/system_task_status/_form.html.erb +9 -0
  211. data/app/views/system_task_status/edit.html.erb +6 -0
  212. data/app/views/system_task_status/index.html.erb +23 -0
  213. data/app/views/system_task_status/new.html.erb +5 -0
  214. data/app/views/system_task_status/show.html.erb +10 -0
  215. data/app/views/task_feedbacks/_list.html.erb +51 -0
  216. data/app/views/task_feedbacks/_side_form.html.erb +56 -0
  217. data/app/views/task_feedbacks/_side_panel.html.erb +64 -0
  218. data/app/views/task_types/_form.html.erb +10 -0
  219. data/app/views/task_types/edit.html.erb +6 -0
  220. data/app/views/task_types/index.html.erb +23 -0
  221. data/app/views/task_types/new.html.erb +5 -0
  222. data/app/views/task_types/show.html.erb +10 -0
  223. data/app/views/tasks/_form.html.erb +52 -0
  224. data/app/views/tasks/_header.html.erb +3 -0
  225. data/app/views/tasks/_list.html.erb +50 -0
  226. data/app/views/tasks/_side_panel.html.erb +64 -0
  227. data/app/views/tasks/create.js.erb +1 -0
  228. data/app/views/tasks/edit.html.erb +6 -0
  229. data/app/views/tasks/index.html.erb +61 -0
  230. data/app/views/tasks/new.html.erb +5 -0
  231. data/app/views/tasks/show.html.erb +46 -0
  232. data/app/views/tests/ajaxes/_form.html.erb +10 -0
  233. data/app/views/tests/ajaxes/_list.html.erb +6 -0
  234. data/app/views/tests/ajaxes/add_and_update.html.erb +22 -0
  235. data/app/views/tests/ajaxes/all.js.erb +2 -0
  236. data/app/views/tests/ajaxes/edit.html.erb +6 -0
  237. data/app/views/tests/ajaxes/index.html.erb +25 -0
  238. data/app/views/tests/ajaxes/new.html.erb +5 -0
  239. data/app/views/tests/ajaxes/show.html.erb +15 -0
  240. data/app/views/tests/js.js +51 -0
  241. data/app/views/tests/lab_ajax/multiselection.html.erb +84 -0
  242. data/app/views/users/_user.html.erb +8 -0
  243. data/app/views/users/edit.html.erb +27 -0
  244. data/app/views/users/index.html.erb +9 -0
  245. data/app/views/users/new.html.erb +24 -0
  246. data/app/views/users/show.html.erb +26 -0
  247. data/bundle +0 -0
  248. data/config.ru +4 -0
  249. data/config/application.rb +73 -0
  250. data/config/boot.rb +6 -0
  251. data/config/database.yml +38 -0
  252. data/config/environment.rb +31 -0
  253. data/config/environments/development.rb +42 -0
  254. data/config/environments/production.rb +68 -0
  255. data/config/environments/test.rb +39 -0
  256. data/config/guara/menus.rb +34 -0
  257. data/config/initializers/active_admin.rb +210 -0
  258. data/config/initializers/backtrace_silencers.rb +7 -0
  259. data/config/initializers/cmgb_rules.rb +2 -0
  260. data/config/initializers/devise.rb +216 -0
  261. data/config/initializers/formtastic.rb +77 -0
  262. data/config/initializers/inflections.rb +19 -0
  263. data/config/initializers/json_paches_utf8.rb +13 -0
  264. data/config/initializers/kaminari.rb +21 -0
  265. data/config/initializers/locale.rb +7 -0
  266. data/config/initializers/meta_search.rb +10 -0
  267. data/config/initializers/mime_types.rb +5 -0
  268. data/config/initializers/secret_token.rb +7 -0
  269. data/config/initializers/session_store.rb +8 -0
  270. data/config/initializers/string.rb +9 -0
  271. data/config/initializers/wrap_parameters.rb +14 -0
  272. data/config/locales/devise.en.yml +57 -0
  273. data/config/locales/devise.pt-BR.yml +62 -0
  274. data/config/locales/pt-BR.yml +404 -0
  275. data/config/routes.rb +129 -0
  276. data/db/migrate/20120610142404_create_users.rb +10 -0
  277. data/db/migrate/20120610183820_add_index_to_users_email.rb +5 -0
  278. data/db/migrate/20120610185217_add_password_digest_to_users.rb +5 -0
  279. data/db/migrate/20120612000411_add_remember_token_to_users.rb +6 -0
  280. data/db/migrate/20120616162515_add_admin_to_users.rb +5 -0
  281. data/db/migrate/20120616215835_create_microposts.rb +11 -0
  282. data/db/migrate/20120617224530_create_relationships.rb +14 -0
  283. data/db/migrate/20120621095918_create_customers.rb +36 -0
  284. data/db/migrate/20120621100528_create_customer_pfs.rb +14 -0
  285. data/db/migrate/20120621100534_create_customer_pjs.rb +13 -0
  286. data/db/migrate/20120621100557_create_emails.rb +13 -0
  287. data/db/migrate/20120621100618_create_tasks.rb +26 -0
  288. data/db/migrate/20120621100639_create_customer_products.rb +14 -0
  289. data/db/migrate/20120621100705_create_districts.rb +11 -0
  290. data/db/migrate/20120621100720_create_cities.rb +11 -0
  291. data/db/migrate/20120624192444_create_business_segments.rb +10 -0
  292. data/db/migrate/20120624224245_create_business_activities.rb +13 -0
  293. data/db/migrate/20120628092744_create_customer_activities.rb +9 -0
  294. data/db/migrate/20120628092754_create_customer_segments.rb +9 -0
  295. data/db/migrate/20120703102859_create_states.rb +10 -0
  296. data/db/migrate/20120705121011_create_contacts.rb +18 -0
  297. data/db/migrate/20120711233943_add_devise_to_users.rb +56 -0
  298. data/db/migrate/20120723102847_create_user_abilities.rb +10 -0
  299. data/db/migrate/20120723104500_create_system_modules.rb +9 -0
  300. data/db/migrate/20120723104639_create_system_abilities.rb +9 -0
  301. data/db/migrate/20120728181903_create_user_groups.rb +10 -0
  302. data/db/migrate/20120729112600_create_users_has_groups.rb +14 -0
  303. data/db/migrate/20120729121922_add_groups_to_users.rb +6 -0
  304. data/db/migrate/20120910002835_create_system_task_status.rb +7 -0
  305. data/db/migrate/20120910010153_create_system_task_resolutions.rb +7 -0
  306. data/db/migrate/20120911021535_create_task_types.rb +10 -0
  307. data/db/migrate/20120911070836_create_task_feedbacks.rb +14 -0
  308. data/db/migrate/20120924022719_create_tests_ajaxes.rb +10 -0
  309. data/db/migrate/20121007131035_create_business_departments.rb +10 -0
  310. data/db/migrate/20121013120849_add_notes_and_other_contacts_to_customer.rb +5 -0
  311. data/db/migrate/20121014201255_create_company_businesses.rb +10 -0
  312. data/db/migrate/20121014202449_add_company_business_to_task_type.rb +6 -0
  313. data/db/migrate/20121014212430_add_primary_company_business_to_user.rb +5 -0
  314. data/db/migrate/20121015101844_add_parent_id_to_system_task_resolution.rb +5 -0
  315. data/db/migrate/20121026231241_create_customer_has_customers.rb +10 -0
  316. data/db/migrate/20121026232755_create_customer_pj_has_customers_pjs.rb +10 -0
  317. data/db/migrate/20121029094047_create_admin_notes.rb +17 -0
  318. data/db/migrate/20121029094048_move_admin_notes_to_comments.rb +25 -0
  319. data/db/migrate/20121103183646_add_enabled_to_cities.rb +5 -0
  320. data/db/migrate/20121104135014_create_customer_financials.rb +17 -0
  321. data/db/migrate/20121104141751_create_addresses.rb +19 -0
  322. data/db/migrate/20121205150619_add_type_id_to_users.rb +5 -0
  323. data/db/schema.rb~ +378 -0
  324. data/db/seeds.rb +99 -0
  325. data/gemfiles/Gemfile.rails.3.2.x +82 -0
  326. data/guara.gemspec +31 -0
  327. data/lib/active_extend/README.md +19 -0
  328. data/lib/active_extend/active_disablable.rb +59 -0
  329. data/lib/active_extend/string_helper.rb +9 -0
  330. data/lib/active_migration.rb +4 -0
  331. data/lib/active_migration/converters/rtf_to_html.rb +123 -0
  332. data/lib/active_migration/dictionary.rb +19 -0
  333. data/lib/active_migration/migration.rb +211 -0
  334. data/lib/active_migration/schemas.rb +143 -0
  335. data/lib/active_migration/spelling_fix.rb +20 -0
  336. data/lib/active_migration/transformer/grouped_field_fixed_spelling.rb +110 -0
  337. data/lib/assets/.gitkeep +0 -0
  338. data/lib/cmgb_rules/app/models/task.rb +19 -0
  339. data/lib/guara/version.rb +3 -0
  340. data/lib/spec/asserts/sheet1.xls +0 -0
  341. data/lib/spec/lib/active_migration_schemas_spec.rb +40 -0
  342. data/lib/spec/lib/active_migration_spec.rb +78 -0
  343. data/lib/spec/spec_helper.rb +121 -0
  344. data/lib/spec/support/active_migration_helper.rb +109 -0
  345. data/lib/spec/support/utilities.rb +7 -0
  346. data/lib/tasks/.gitkeep +0 -0
  347. data/lib/tasks/add_privilegies.rake +6 -0
  348. data/lib/tasks/external_migration.rake +22 -0
  349. data/lib/tasks/sample_data.rake +77 -0
  350. data/lib/tasks/smaple_data_test.rake +13 -0
  351. data/lib/templates/erb/scaffold/_form.html.erb +11 -0
  352. data/public/404.html +26 -0
  353. data/public/422.html +26 -0
  354. data/public/500.html +25 -0
  355. data/public/data.txt +1 -0
  356. data/public/favicon.ico +0 -0
  357. data/public/javascripts/autocomplete-rails.js +16 -0
  358. data/public/robots.txt +5 -0
  359. data/script/create_db +5 -0
  360. data/script/rails +6 -0
  361. data/script/recreate_db +5 -0
  362. data/script/recreate_db.bat +9 -0
  363. data/script/recreate_db_test +5 -0
  364. data/script/recreate_development_db +10 -0
  365. data/spec/controllers/business_activities_controller_spec.disabled +167 -0
  366. data/spec/controllers/business_departments_controller_spec.disabled +164 -0
  367. data/spec/controllers/business_segments_controller_spec.disabled +165 -0
  368. data/spec/controllers/company_businesses_controller_spec.disabled +164 -0
  369. data/spec/controllers/system_task_status_controller_spec.disabled +164 -0
  370. data/spec/controllers/system_task_status_spec.disabled +11 -0
  371. data/spec/controllers/task_types_controller_spec.disabled +164 -0
  372. data/spec/controllers/tasks_controller_spec.disabled +23 -0
  373. data/spec/controllers/tests/ajaxes_controller_spec.disabled +164 -0
  374. data/spec/factories.rb +101 -0
  375. data/spec/factories/addresses.rb +13 -0
  376. data/spec/factories/business_departments.rb +8 -0
  377. data/spec/factories/company_businesses.rb +8 -0
  378. data/spec/factories/customer_financials.rb +11 -0
  379. data/spec/factories/customer_has_customers.rb +8 -0
  380. data/spec/factories/customer_pj_has_customers_pjs.rb +8 -0
  381. data/spec/factories/system_task_resolutions.rb +7 -0
  382. data/spec/factories/system_task_status.rb +7 -0
  383. data/spec/factories/task.rb +17 -0
  384. data/spec/factories/task_feedbacks.rb +19 -0
  385. data/spec/factories/task_types.rb +8 -0
  386. data/spec/factories/tests_ajaxes.rb +8 -0
  387. data/spec/helpers/business_activities_helper_spec.rb +15 -0
  388. data/spec/helpers/business_departments_helper_spec.rb +15 -0
  389. data/spec/helpers/business_segments_helper_spec.rb +15 -0
  390. data/spec/helpers/company_businesses_helper_spec.rb +15 -0
  391. data/spec/helpers/customers/contacts_helper_spec.rb +15 -0
  392. data/spec/helpers/menu_helper_spec.rb +25 -0
  393. data/spec/helpers/tests/ajaxes_helper_spec.rb +15 -0
  394. data/spec/helpers/users_helpers_spec.rb +32 -0
  395. data/spec/models/address_spec.rb +5 -0
  396. data/spec/models/business_activity_spec.rb +5 -0
  397. data/spec/models/business_department_spec.rb +5 -0
  398. data/spec/models/business_segment_spec.rb +5 -0
  399. data/spec/models/city_spec.rb +5 -0
  400. data/spec/models/company_business_spec.rb +19 -0
  401. data/spec/models/contact_spec.rb +60 -0
  402. data/spec/models/customer_activity_spec.rb +5 -0
  403. data/spec/models/customer_financial_spec.rb +48 -0
  404. data/spec/models/customer_has_customers_spec.rb +18 -0
  405. data/spec/models/customer_pf_spec.rb +24 -0
  406. data/spec/models/customer_pj_has_customers_pj_spec.rb +34 -0
  407. data/spec/models/customer_pj_spec.rb +72 -0
  408. data/spec/models/customer_product_spec.rb +5 -0
  409. data/spec/models/customer_segment_spec.rb +5 -0
  410. data/spec/models/customer_spec.rb +135 -0
  411. data/spec/models/district_spec.rb +5 -0
  412. data/spec/models/emails_spec.rb +24 -0
  413. data/spec/models/micropost_spec.rb +49 -0
  414. data/spec/models/relationship_spec.rb +38 -0
  415. data/spec/models/state_spec.rb +5 -0
  416. data/spec/models/system_ability_spec.rb +5 -0
  417. data/spec/models/system_module_spec.rb +5 -0
  418. data/spec/models/system_task_resolution_spec.rb +17 -0
  419. data/spec/models/system_task_status_spec.rb +17 -0
  420. data/spec/models/task_feedback_spec.rb +46 -0
  421. data/spec/models/task_spec.rb +176 -0
  422. data/spec/models/task_type_spec.rb +27 -0
  423. data/spec/models/tests/ajax_spec.rb +5 -0
  424. data/spec/models/user_ability_spec.rb +35 -0
  425. data/spec/models/user_group_spec.rb +26 -0
  426. data/spec/models/user_spec.rb +274 -0
  427. data/spec/models/users_has_groups_spec.rb +29 -0
  428. data/spec/requests/authentication_pages_spec.rb +157 -0
  429. data/spec/requests/business_activities_spec.rb +7 -0
  430. data/spec/requests/business_departments_spec.rb +7 -0
  431. data/spec/requests/business_segments_spec.rb +7 -0
  432. data/spec/requests/company_businesses_spec.rb +11 -0
  433. data/spec/requests/customer_contacts_pages_spec.rb +96 -0
  434. data/spec/requests/customer_pages_spec.rb +60 -0
  435. data/spec/requests/micropost_pages_spec.rb +58 -0
  436. data/spec/requests/static_pages_spec.rb +57 -0
  437. data/spec/requests/task_pages_spec.rb +124 -0
  438. data/spec/requests/tests/tests_ajaxes_spec.rb +11 -0
  439. data/spec/requests/user_abilities_pages_spec.rb +73 -0
  440. data/spec/requests/user_pages_spec.rb +116 -0
  441. data/spec/routing/business_activities_routing_spec.rb +35 -0
  442. data/spec/routing/business_departments_routing_spec.rb +35 -0
  443. data/spec/routing/business_segments_routing_spec.rb +35 -0
  444. data/spec/routing/company_businesses_routing_spec.rb +35 -0
  445. data/spec/routing/system_task_status_routing_spec.rb +35 -0
  446. data/spec/routing/task_types_routing_spec.rb +35 -0
  447. data/spec/routing/tests/ajaxes_routing_spec.rb +35 -0
  448. data/spec/spec_helper.rb +123 -0
  449. data/spec/support/custom_matchers.rb +9 -0
  450. data/spec/support/utilities.rb +120 -0
  451. data/spec/views/business_departments/edit.html.erb_spec.rb +20 -0
  452. data/spec/views/business_departments/index.html.erb_spec.disabled +23 -0
  453. data/spec/views/business_departments/new.html.erb_spec.rb +20 -0
  454. data/spec/views/business_departments/show.html.erb_spec.rb +17 -0
  455. data/spec/views/company_businesses/edit.html.erb_spec.rb +20 -0
  456. data/spec/views/company_businesses/index.html.erb_spec.rb +23 -0
  457. data/spec/views/company_businesses/new.html.erb_spec.rb +20 -0
  458. data/spec/views/company_businesses/show.html.erb_spec.rb +17 -0
  459. data/spec/views/task_types/edit.html.erb_spec.rb +18 -0
  460. data/spec/views/task_types/index.html.erb_spec.rb +20 -0
  461. data/spec/views/task_types/new.html.erb_spec.rb +18 -0
  462. data/spec/views/task_types/show.html.erb_spec.rb +15 -0
  463. data/test/fixtures/.gitkeep +0 -0
  464. data/test/functional/.gitkeep +0 -0
  465. data/test/integration/.gitkeep +0 -0
  466. data/test/performance/browsing_test.rb +12 -0
  467. data/test/test_helper.rb +13 -0
  468. data/test/unit/.gitkeep +0 -0
  469. data/vendor/assets/javascripts/.gitkeep +0 -0
  470. data/vendor/assets/stylesheets/.gitkeep +0 -0
  471. data/vendor/assets/stylesheets/active_admin/_base.css.scss +45 -0
  472. data/vendor/assets/stylesheets/active_admin/_forms.css.scss +270 -0
  473. data/vendor/assets/stylesheets/active_admin/_header.css.scss +137 -0
  474. data/vendor/assets/stylesheets/active_admin/_mixins.css.scss +1 -0
  475. data/vendor/assets/stylesheets/active_admin/_typography.css.scss +100 -0
  476. data/vendor/assets/stylesheets/active_admin/components/_batch_actions.css.scss +11 -0
  477. data/vendor/assets/stylesheets/active_admin/components/_blank_slates.scss +31 -0
  478. data/vendor/assets/stylesheets/active_admin/components/_breadcrumbs.scss +20 -0
  479. data/vendor/assets/stylesheets/active_admin/components/_buttons.scss +11 -0
  480. data/vendor/assets/stylesheets/active_admin/components/_columns.scss +3 -0
  481. data/vendor/assets/stylesheets/active_admin/components/_comments.css.scss +40 -0
  482. data/vendor/assets/stylesheets/active_admin/components/_date_picker.css.scss +123 -0
  483. data/vendor/assets/stylesheets/active_admin/components/_dropdown_menu.scss +151 -0
  484. data/vendor/assets/stylesheets/active_admin/components/_flash_messages.css.scss +39 -0
  485. data/vendor/assets/stylesheets/active_admin/components/_grid.scss +9 -0
  486. data/vendor/assets/stylesheets/active_admin/components/_links.scss +5 -0
  487. data/vendor/assets/stylesheets/active_admin/components/_pagination.scss +34 -0
  488. data/vendor/assets/stylesheets/active_admin/components/_panels.scss +6 -0
  489. data/vendor/assets/stylesheets/active_admin/components/_popovers.css.scss +123 -0
  490. data/vendor/assets/stylesheets/active_admin/components/_scopes.scss +10 -0
  491. data/vendor/assets/stylesheets/active_admin/components/_status_tags.scss +12 -0
  492. data/vendor/assets/stylesheets/active_admin/components/_table_tools.css.scss +94 -0
  493. data/vendor/assets/stylesheets/active_admin/components/_tables.css.scss +108 -0
  494. data/vendor/assets/stylesheets/active_admin/mixins/_all.css.scss +11 -0
  495. data/vendor/assets/stylesheets/active_admin/mixins/_buttons.css.scss +66 -0
  496. data/vendor/assets/stylesheets/active_admin/mixins/_gradients.css.scss +37 -0
  497. data/vendor/assets/stylesheets/active_admin/mixins/_icons.css.scss +24 -0
  498. data/vendor/assets/stylesheets/active_admin/mixins/_reset.css.scss +165 -0
  499. data/vendor/assets/stylesheets/active_admin/mixins/_rounded.css.scss +43 -0
  500. data/vendor/assets/stylesheets/active_admin/mixins/_sections.css.scss +36 -0
  501. data/vendor/assets/stylesheets/active_admin/mixins/_shadows.css.scss +22 -0
  502. data/vendor/assets/stylesheets/active_admin/mixins/_typography.scss +3 -0
  503. data/vendor/assets/stylesheets/active_admin/mixins/_utilities.scss +26 -0
  504. data/vendor/assets/stylesheets/active_admin/mixins/_variables.css.scss +24 -0
  505. data/vendor/assets/stylesheets/active_admin/pages/_dashboard.scss +5 -0
  506. data/vendor/assets/stylesheets/active_admin/pages/_logged_out.scss +44 -0
  507. data/vendor/assets/stylesheets/active_admin/print.css.scss +290 -0
  508. data/vendor/assets/stylesheets/active_admin/structure/_footer.scss +14 -0
  509. data/vendor/assets/stylesheets/active_admin/structure/_main_structure.scss +26 -0
  510. data/vendor/assets/stylesheets/active_admin/structure/_title_bar.scss +44 -0
  511. data/vendor/plugins/.gitkeep +0 -0
  512. metadata +731 -0
@@ -0,0 +1,10 @@
1
+ class CreateUserAbilities < ActiveRecord::Migration
2
+ def change
3
+ create_table :user_abilities do |t|
4
+ t.integer :module_id
5
+ t.integer :ability_id
6
+ t.references :skilled, :polymorphic => true
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ class CreateSystemModules < ActiveRecord::Migration
2
+ def change
3
+ create_table :system_modules do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class CreateSystemAbilities < ActiveRecord::Migration
2
+ def change
3
+ create_table :system_abilities do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ class CreateUserGroups < ActiveRecord::Migration
2
+ def change
3
+ create_table :user_groups do |t|
4
+ t.string :name
5
+ t.boolean :enabled, :default => true
6
+ t.boolean :system, :default => false
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ class CreateUsersHasGroups < ActiveRecord::Migration
2
+ def change
3
+ create_table :users_has_groups do |t|
4
+ t.integer :user_id
5
+ t.integer :user_group_id
6
+
7
+ t.timestamps
8
+ end
9
+
10
+ add_index :users_has_groups, :user_id
11
+ add_index :users_has_groups, :user_group_id
12
+ add_index :users_has_groups, [:user_id, :user_group_id], unique: true
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ class AddGroupsToUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :primary_group_id, :integer
4
+ add_index :users, :primary_group_id
5
+ end
6
+ end
@@ -0,0 +1,7 @@
1
+ class CreateSystemTaskStatus < ActiveRecord::Migration
2
+ def change
3
+ create_table :system_task_status do |t|
4
+ t.string :name
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ class CreateSystemTaskResolutions < ActiveRecord::Migration
2
+ def change
3
+ create_table :system_task_resolutions do |t|
4
+ t.string :name
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ class CreateTaskTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :task_types do |t|
4
+ t.string :name
5
+ t.boolean :enabled
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ class CreateTaskFeedbacks < ActiveRecord::Migration
2
+ def change
3
+ create_table :task_feedbacks do |t|
4
+ t.integer :task_id
5
+ t.datetime :date
6
+ t.string :notes
7
+ t.integer :user_id
8
+ t.integer :status_id
9
+ t.integer :resolution_id
10
+
11
+ t.timestamps
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,10 @@
1
+ class CreateTestsAjaxes < ActiveRecord::Migration
2
+ def change
3
+ create_table :tests_ajaxes do |t|
4
+ t.string :name
5
+ t.text :description
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ class CreateBusinessDepartments < ActiveRecord::Migration
2
+ def change
3
+ create_table :business_departments do |t|
4
+ t.string :name
5
+ t.boolean :enabled
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ class AddNotesAndOtherContactsToCustomer < ActiveRecord::Migration
2
+ def change
3
+ add_column :customers, :other_contacts, :string, :limit => 70
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ class CreateCompanyBusinesses < ActiveRecord::Migration
2
+ def change
3
+ create_table :company_businesses do |t|
4
+ t.string :name
5
+ t.boolean :enabled
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,6 @@
1
+ class AddCompanyBusinessToTaskType < ActiveRecord::Migration
2
+ def change
3
+ add_column :task_types, :company_business_id, :integer
4
+ add_index :task_types, :company_business_id
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddPrimaryCompanyBusinessToUser < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :primary_company_business_id, :integer
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddParentIdToSystemTaskResolution < ActiveRecord::Migration
2
+ def change
3
+ add_column :system_task_resolutions, :parent_id, :integer
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ class CreateCustomerHasCustomers < ActiveRecord::Migration
2
+ def change
3
+ create_table :customer_has_customers do |t|
4
+ t.integer :from_id
5
+ t.integer :to_id
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ class CreateCustomerPjHasCustomersPjs < ActiveRecord::Migration
2
+ def change
3
+ create_table :customer_pj_has_customers_pjs do |t|
4
+ t.integer :from_id
5
+ t.integer :to_id
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,17 @@
1
+ class CreateAdminNotes < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :admin_notes do |t|
4
+ t.string :resource_id, :null => false
5
+ t.string :resource_type, :null => false
6
+ t.references :admin_user, :polymorphic => true
7
+ t.text :body
8
+ t.timestamps
9
+ end
10
+ add_index :admin_notes, [:resource_type, :resource_id]
11
+ add_index :admin_notes, [:admin_user_type, :admin_user_id]
12
+ end
13
+
14
+ def self.down
15
+ drop_table :admin_notes
16
+ end
17
+ end
@@ -0,0 +1,25 @@
1
+ class MoveAdminNotesToComments < ActiveRecord::Migration
2
+ def self.up
3
+ remove_index :admin_notes, [:admin_user_type, :admin_user_id]
4
+ rename_table :admin_notes, :active_admin_comments
5
+ rename_column :active_admin_comments, :admin_user_type, :author_type
6
+ rename_column :active_admin_comments, :admin_user_id, :author_id
7
+ add_column :active_admin_comments, :namespace, :string
8
+ add_index :active_admin_comments, [:namespace]
9
+ add_index :active_admin_comments, [:author_type, :author_id]
10
+
11
+ # Update all the existing comments to the default namespace
12
+ say "Updating any existing comments to the #{ActiveAdmin.application.default_namespace} namespace."
13
+ execute "UPDATE active_admin_comments SET namespace='#{ActiveAdmin.application.default_namespace}'"
14
+ end
15
+
16
+ def self.down
17
+ remove_index :active_admin_comments, :column => [:author_type, :author_id]
18
+ remove_index :active_admin_comments, :column => [:namespace]
19
+ remove_column :active_admin_comments, :namespace
20
+ rename_column :active_admin_comments, :author_id, :admin_user_id
21
+ rename_column :active_admin_comments, :author_type, :admin_user_type
22
+ rename_table :active_admin_comments, :admin_notes
23
+ add_index :admin_notes, [:admin_user_type, :admin_user_id]
24
+ end
25
+ end
@@ -0,0 +1,5 @@
1
+ class AddEnabledToCities < ActiveRecord::Migration
2
+ def change
3
+ add_column :cities, :enabled, :boolean
4
+ end
5
+ end
@@ -0,0 +1,17 @@
1
+ class CreateCustomerFinancials < ActiveRecord::Migration
2
+ def change
3
+ create_table :customer_financials do |t|
4
+ t.references :customer
5
+ t.boolean :billing_address_different
6
+ t.integer :contact_leader_id
7
+ t.boolean :payment_pending
8
+ t.string :payment_pending_message, :limit => 500
9
+
10
+ t.references :address
11
+
12
+ t.string :notes, :limit => 1000
13
+
14
+ t.timestamps
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,19 @@
1
+ class CreateAddresses < ActiveRecord::Migration
2
+ def change
3
+ create_table :addresses do |t|
4
+ t.integer :country_id
5
+ t.integer :state_id
6
+ t.integer :city_id
7
+ t.integer :district_id
8
+ t.string :address, :limit => 120
9
+ t.string :complement, :limit => 30
10
+ t.string :postal_code, :limit => 20
11
+
12
+ t.references :addressable, :polymorphic => true
13
+
14
+ t.timestamps
15
+ end
16
+
17
+ add_index :addresses, [:state_id, :city_id]
18
+ end
19
+ end
@@ -0,0 +1,5 @@
1
+ class AddTypeIdToUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :type_id, :integer, :null => false, :default => 0
4
+ end
5
+ end
data/db/schema.rb~ ADDED
@@ -0,0 +1,378 @@
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 => 20121205150619) do
15
+
16
+ create_table "active_admin_comments", :force => true do |t|
17
+ t.string "resource_id", :null => false
18
+ t.string "resource_type", :null => false
19
+ t.integer "author_id"
20
+ t.string "author_type"
21
+ t.text "body"
22
+ t.datetime "created_at", :null => false
23
+ t.datetime "updated_at", :null => false
24
+ t.string "namespace"
25
+ end
26
+
27
+ add_index "active_admin_comments", ["author_type", "author_id"], :name => "index_active_admin_comments_on_author_type_and_author_id"
28
+ add_index "active_admin_comments", ["namespace"], :name => "index_active_admin_comments_on_namespace"
29
+ add_index "active_admin_comments", ["resource_type", "resource_id"], :name => "index_admin_notes_on_resource_type_and_resource_id"
30
+
31
+ create_table "addresses", :force => true do |t|
32
+ t.integer "country_id"
33
+ t.integer "state_id"
34
+ t.integer "city_id"
35
+ t.integer "district_id"
36
+ t.string "address", :limit => 120
37
+ t.string "complement", :limit => 30
38
+ t.string "postal_code", :limit => 20
39
+ t.integer "addressable_id"
40
+ t.string "addressable_type"
41
+ t.datetime "created_at", :null => false
42
+ t.datetime "updated_at", :null => false
43
+ end
44
+
45
+ add_index "addresses", ["state_id", "city_id"], :name => "index_addresses_on_state_id_and_city_id"
46
+
47
+ create_table "business_activities", :force => true do |t|
48
+ t.string "name", :limit => 100
49
+ t.boolean "enabled", :default => true
50
+ t.integer "business_segment_id"
51
+ t.datetime "created_at", :null => false
52
+ t.datetime "updated_at", :null => false
53
+ end
54
+
55
+ add_index "business_activities", ["business_segment_id"], :name => "index_business_activities_on_business_segment_id"
56
+
57
+ create_table "business_departments", :force => true do |t|
58
+ t.string "name"
59
+ t.boolean "enabled"
60
+ t.datetime "created_at", :null => false
61
+ t.datetime "updated_at", :null => false
62
+ end
63
+
64
+ create_table "business_segments", :force => true do |t|
65
+ t.string "name", :limit => 100
66
+ t.boolean "enabled", :default => true
67
+ t.datetime "created_at", :null => false
68
+ t.datetime "updated_at", :null => false
69
+ end
70
+
71
+ create_table "cities", :force => true do |t|
72
+ t.string "name", :limit => 60
73
+ t.integer "state_id"
74
+ t.datetime "created_at", :null => false
75
+ t.datetime "updated_at", :null => false
76
+ t.boolean "enabled"
77
+ end
78
+
79
+ add_index "cities", ["state_id"], :name => "index_cities_on_state_id"
80
+
81
+ create_table "company_businesses", :force => true do |t|
82
+ t.string "name"
83
+ t.boolean "enabled"
84
+ t.datetime "created_at", :null => false
85
+ t.datetime "updated_at", :null => false
86
+ end
87
+
88
+ create_table "contacts", :force => true do |t|
89
+ t.integer "customer_id"
90
+ t.string "name", :limit => 150
91
+ t.integer "department_id"
92
+ t.string "business_function"
93
+ t.string "phone"
94
+ t.string "cell"
95
+ t.string "birthday"
96
+ t.datetime "created_at", :null => false
97
+ t.datetime "updated_at", :null => false
98
+ end
99
+
100
+ add_index "contacts", ["customer_id"], :name => "index_contacts_on_customer_id"
101
+ add_index "contacts", ["department_id"], :name => "index_contacts_on_department_id"
102
+
103
+ create_table "customer_activities", :force => true do |t|
104
+ t.integer "customer_pj_id"
105
+ t.integer "activity_id"
106
+ t.datetime "created_at", :null => false
107
+ t.datetime "updated_at", :null => false
108
+ end
109
+
110
+ create_table "customer_financials", :force => true do |t|
111
+ t.integer "customer_id"
112
+ t.boolean "billing_address_different"
113
+ t.integer "contact_leader_id"
114
+ t.boolean "payment_pending"
115
+ t.string "payment_pending_message", :limit => 500
116
+ t.integer "address_id"
117
+ t.string "notes", :limit => 1000
118
+ t.datetime "created_at", :null => false
119
+ t.datetime "updated_at", :null => false
120
+ end
121
+
122
+ create_table "customer_has_customers", :force => true do |t|
123
+ t.integer "from_id"
124
+ t.integer "to_id"
125
+ t.datetime "created_at", :null => false
126
+ t.datetime "updated_at", :null => false
127
+ end
128
+
129
+ create_table "customer_pfs", :force => true do |t|
130
+ t.string "gender", :limit => 1
131
+ t.integer "company"
132
+ t.string "business_address", :limit => 120
133
+ t.string "department", :limit => 20
134
+ t.string "corporate_function", :limit => 20
135
+ t.string "cellphone", :limit => 15
136
+ t.string "graduated", :limit => 30
137
+ t.datetime "created_at", :null => false
138
+ t.datetime "updated_at", :null => false
139
+ end
140
+
141
+ create_table "customer_pj_has_customers_pjs", :force => true do |t|
142
+ t.integer "from_id"
143
+ t.integer "to_id"
144
+ t.datetime "created_at", :null => false
145
+ t.datetime "updated_at", :null => false
146
+ end
147
+
148
+ create_table "customer_pjs", :force => true do |t|
149
+ t.string "fax", :limit => 35
150
+ t.integer "total_employes"
151
+ t.integer "segment_id"
152
+ t.integer "activity_id"
153
+ t.float "annual_revenues"
154
+ t.datetime "created_at", :null => false
155
+ t.datetime "updated_at", :null => false
156
+ end
157
+
158
+ create_table "customer_products", :force => true do |t|
159
+ t.integer "costumer_id"
160
+ t.integer "product_id"
161
+ t.date "date"
162
+ t.boolean "used", :default => true
163
+ t.integer "rate_id"
164
+ t.datetime "created_at", :null => false
165
+ t.datetime "updated_at", :null => false
166
+ end
167
+
168
+ create_table "customer_segments", :force => true do |t|
169
+ t.integer "customer_pj_id"
170
+ t.integer "segment_id"
171
+ t.datetime "created_at", :null => false
172
+ t.datetime "updated_at", :null => false
173
+ end
174
+
175
+ create_table "customers", :force => true do |t|
176
+ t.string "name", :limit => 120, :null => false
177
+ t.string "doc", :limit => 14
178
+ t.string "doc_rg", :limit => 22
179
+ t.string "name_sec", :limit => 120
180
+ t.string "address", :limit => 150
181
+ t.integer "district_id"
182
+ t.integer "city_id"
183
+ t.integer "state_id"
184
+ t.string "postal", :limit => 8
185
+ t.text "notes"
186
+ t.date "birthday"
187
+ t.string "phone", :limit => 35
188
+ t.string "social_link", :limit => 200
189
+ t.string "site", :limit => 200
190
+ t.boolean "is_customer", :default => false
191
+ t.integer "parent_id"
192
+ t.boolean "enabled", :default => true
193
+ t.integer "person_id"
194
+ t.string "person_type"
195
+ t.boolean "complete"
196
+ t.float "annual_revenue"
197
+ t.integer "external_key"
198
+ t.datetime "created_at", :null => false
199
+ t.datetime "updated_at", :null => false
200
+ t.string "other_contacts", :limit => 70
201
+ end
202
+
203
+ create_table "districts", :force => true do |t|
204
+ t.string "name", :limit => 60
205
+ t.integer "city_id"
206
+ t.datetime "created_at", :null => false
207
+ t.datetime "updated_at", :null => false
208
+ end
209
+
210
+ add_index "districts", ["city_id"], :name => "index_districts_on_city_id"
211
+
212
+ create_table "emails", :force => true do |t|
213
+ t.integer "customer_id"
214
+ t.string "email", :limit => 120
215
+ t.boolean "infos", :default => true
216
+ t.boolean "private", :default => true
217
+ t.integer "emailable_id"
218
+ t.string "emailable_type"
219
+ t.datetime "created_at", :null => false
220
+ t.datetime "updated_at", :null => false
221
+ end
222
+
223
+ create_table "microposts", :force => true do |t|
224
+ t.string "content"
225
+ t.integer "user_id"
226
+ t.datetime "created_at", :null => false
227
+ t.datetime "updated_at", :null => false
228
+ end
229
+
230
+ add_index "microposts", ["user_id", "created_at"], :name => "index_microposts_on_user_id_and_created_at"
231
+
232
+ create_table "relationships", :force => true do |t|
233
+ t.integer "follower_id"
234
+ t.integer "followed_id"
235
+ t.datetime "created_at", :null => false
236
+ t.datetime "updated_at", :null => false
237
+ end
238
+
239
+ add_index "relationships", ["followed_id"], :name => "index_relationships_on_followed_id"
240
+ add_index "relationships", ["follower_id", "followed_id"], :name => "index_relationships_on_follower_id_and_followed_id", :unique => true
241
+ add_index "relationships", ["follower_id"], :name => "index_relationships_on_follower_id"
242
+
243
+ create_table "states", :force => true do |t|
244
+ t.string "name", :limit => 30
245
+ t.string "acronym", :limit => 2
246
+ t.datetime "created_at", :null => false
247
+ t.datetime "updated_at", :null => false
248
+ end
249
+
250
+ create_table "system_abilities", :force => true do |t|
251
+ t.string "name"
252
+ t.datetime "created_at", :null => false
253
+ t.datetime "updated_at", :null => false
254
+ end
255
+
256
+ create_table "system_modules", :force => true do |t|
257
+ t.string "name"
258
+ t.datetime "created_at", :null => false
259
+ t.datetime "updated_at", :null => false
260
+ end
261
+
262
+ create_table "system_task_resolutions", :force => true do |t|
263
+ t.string "name"
264
+ t.integer "parent_id"
265
+ end
266
+
267
+ create_table "system_task_status", :force => true do |t|
268
+ t.string "name"
269
+ end
270
+
271
+ create_table "task_feedbacks", :force => true do |t|
272
+ t.integer "task_id"
273
+ t.datetime "date"
274
+ t.string "notes"
275
+ t.integer "user_id"
276
+ t.integer "status_id"
277
+ t.integer "resolution_id"
278
+ t.datetime "created_at", :null => false
279
+ t.datetime "updated_at", :null => false
280
+ end
281
+
282
+ create_table "task_types", :force => true do |t|
283
+ t.string "name"
284
+ t.boolean "enabled"
285
+ t.datetime "created_at", :null => false
286
+ t.datetime "updated_at", :null => false
287
+ t.integer "company_business_id"
288
+ end
289
+
290
+ add_index "task_types", ["company_business_id"], :name => "index_task_types_on_company_business_id"
291
+
292
+ create_table "tasks", :force => true do |t|
293
+ t.string "name", :limit => 60
294
+ t.integer "interested_id"
295
+ t.string "interested_type"
296
+ t.integer "contact_id"
297
+ t.string "contact_type"
298
+ t.datetime "due_time"
299
+ t.datetime "finish_time"
300
+ t.string "notes", :limit => 140
301
+ t.string "description", :limit => 1000
302
+ t.integer "user_id"
303
+ t.integer "status_id"
304
+ t.integer "type_id"
305
+ t.integer "assigned_id"
306
+ t.integer "resolution_id"
307
+ t.datetime "created_at", :null => false
308
+ t.datetime "updated_at", :null => false
309
+ end
310
+
311
+ add_index "tasks", ["assigned_id"], :name => "index_tasks_on_assigned_id"
312
+ add_index "tasks", ["interested_id", "interested_type"], :name => "index_tasks_on_interested_id_and_interested_type"
313
+ add_index "tasks", ["status_id"], :name => "index_tasks_on_status_id"
314
+ add_index "tasks", ["type_id"], :name => "index_tasks_on_type_id"
315
+
316
+ create_table "tests_ajaxes", :force => true do |t|
317
+ t.string "name"
318
+ t.text "description"
319
+ t.datetime "created_at", :null => false
320
+ t.datetime "updated_at", :null => false
321
+ end
322
+
323
+ create_table "user_abilities", :force => true do |t|
324
+ t.integer "module_id"
325
+ t.integer "ability_id"
326
+ t.integer "skilled_id"
327
+ t.string "skilled_type"
328
+ t.datetime "created_at", :null => false
329
+ t.datetime "updated_at", :null => false
330
+ end
331
+
332
+ create_table "user_groups", :force => true do |t|
333
+ t.string "name"
334
+ t.boolean "enabled", :default => true
335
+ t.boolean "system", :default => false
336
+ t.datetime "created_at", :null => false
337
+ t.datetime "updated_at", :null => false
338
+ end
339
+
340
+ create_table "users", :force => true do |t|
341
+ t.string "name", :limit => 25
342
+ t.string "email", :limit => 100
343
+ t.boolean "enabled", :default => true
344
+ t.datetime "created_at", :null => false
345
+ t.datetime "updated_at", :null => false
346
+ t.string "remember_token"
347
+ t.boolean "admin", :default => false
348
+ t.string "encrypted_password", :default => "", :null => false
349
+ t.string "reset_password_token"
350
+ t.datetime "reset_password_sent_at"
351
+ t.datetime "remember_created_at"
352
+ t.integer "sign_in_count", :default => 0
353
+ t.datetime "current_sign_in_at"
354
+ t.datetime "last_sign_in_at"
355
+ t.string "current_sign_in_ip"
356
+ t.string "last_sign_in_ip"
357
+ t.integer "primary_group_id"
358
+ t.integer "primary_company_business_id"
359
+ t.integer "type_id", :default => 0, :null => false
360
+ end
361
+
362
+ add_index "users", ["email"], :name => "index_users_on_email", :unique => true
363
+ add_index "users", ["primary_group_id"], :name => "index_users_on_primary_group_id"
364
+ add_index "users", ["remember_token"], :name => "index_users_on_remember_token"
365
+ add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
366
+
367
+ create_table "users_has_groups", :force => true do |t|
368
+ t.integer "user_id"
369
+ t.integer "user_group_id"
370
+ t.datetime "created_at", :null => false
371
+ t.datetime "updated_at", :null => false
372
+ end
373
+
374
+ add_index "users_has_groups", ["user_group_id"], :name => "index_users_has_groups_on_user_group_id"
375
+ add_index "users_has_groups", ["user_id", "user_group_id"], :name => "index_users_has_groups_on_user_id_and_user_group_id", :unique => true
376
+ add_index "users_has_groups", ["user_id"], :name => "index_users_has_groups_on_user_id"
377
+
378
+ end