20170714000001_object_manager_user_email_optional.rb 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. class ObjectManagerUserEmailOptional < ActiveRecord::Migration[4.2]
  2. def up
  3. # return if it's a new setup
  4. return if !Setting.find_by(name: 'system_init_done')
  5. ObjectManager::Attribute.add(
  6. force: true,
  7. object: 'User',
  8. name: 'email',
  9. display: 'Email',
  10. data_type: 'input',
  11. data_option: {
  12. type: 'email',
  13. maxlength: 150,
  14. null: true,
  15. item_class: 'formGroup--halfSize',
  16. },
  17. editable: false,
  18. active: true,
  19. screens: {
  20. signup: {
  21. '-all-' => {
  22. null: false,
  23. },
  24. },
  25. invite_agent: {
  26. '-all-' => {
  27. null: false,
  28. },
  29. },
  30. invite_customer: {
  31. '-all-' => {
  32. null: false,
  33. },
  34. },
  35. edit: {
  36. '-all-' => {
  37. null: true,
  38. },
  39. },
  40. view: {
  41. '-all-' => {
  42. shown: true,
  43. },
  44. },
  45. },
  46. to_create: false,
  47. to_migrate: false,
  48. to_delete: false,
  49. position: 400,
  50. )
  51. end
  52. end