Revision 84f5447b src/sunstone/routes/support.rb

View differences:

src/sunstone/routes/support.rb
14 14
# limitations under the License.                                             #
15 15
#--------------------------------------------------------------------------- #
16 16

  
17
UNSUPPORTED_RUBY = (RUBY_VERSION =~ /^1.8/) != nil
18

  
17 19
begin
18 20
    require 'zendesk_api'
19 21
rescue LoadError
......
72 74

  
73 75
    def zrequest_to_one(zrequest)
74 76
        one_zrequest = {
75
            "id" => zrequest.id, ### TODO: .id in 1.8.7 fails!!
77
            "id" => zrequest.id,
76 78
            "url" => zrequest.url,
77 79
            "subject" => zrequest.subject,
78 80
            "description" => zrequest.description,
......
83 85
        }
84 86

  
85 87
        zrequest.custom_fields.each { |field|
86
            case field.id ### TODO: .id in 1.8.7 fails!!
88
            case field.id
87 89
            when 391130
88 90
                one_zrequest["opennebula_version"] = field.value
89 91
            when 391197
......
109 111
    end
110 112

  
111 113
    def check_zendesk_api_gem
114
        if UNSUPPORTED_RUBY
115
            error 500, "Ruby version >= 1.9 is required"
116
        end
117

  
112 118
        if !ZENDESK_API_GEM
113 119
            error 500, "zendesk_api gem missing"
114 120
        end

Also available in: Unified diff