1. Ruby / Говнокод #8792

    −101

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    def type
        return 'Anonymous'   if self.builtin == BUILTIN_ANONYMOUS
        return 'Non Member'  if self.builtin == BUILTIN_NON_MEMBER
        return 'Member'      if self.builtin == BUILTIN_MEMBER
        return 'User'        if self.builtin == BUILTIN_USER
        return 'Manager'     if self.builtin == BUILTIN_MANAGER
        return 'Architect'   if self.builtin == BUILTIN_ARCHITECT
        return 'Designer'    if self.builtin == BUILTIN_DESIGNER
        return 'Customer'    if self.builtin == BUILTIN_CUSTOMER
        return 'Vendor'      if self.builtin == BUILTIN_VENDOR
        return 'Dealer'      if self.builtin == BUILTIN_DEALER
      end
    
      def require_name
        return 'is_anonymous'   if self.builtin == BUILTIN_ANONYMOUS
        return 'is_non_member'  if self.builtin == BUILTIN_NON_MEMBER
        return 'is_member'      if self.builtin == BUILTIN_MEMBER
        return 'is_user'        if self.builtin == BUILTIN_USER
        return 'is_manager'     if self.builtin == BUILTIN_MANAGER
        return 'is_architect'   if self.builtin == BUILTIN_ARCHITECT
        return 'is_designer'    if self.builtin == BUILTIN_DESIGNER
        return 'is_customer'    if self.builtin == BUILTIN_CUSTOMER
        return 'is_vendor'      if self.builtin == BUILTIN_VENDOR
        return 'is_dealer'      if self.builtin == BUILTIN_DEALER
      end

    еще ниже в модели

    Запостил: opak, 10 Декабря 2011

    Комментарии (12) RSS

    Добавить комментарий