app/models/lit/source.rb in lit-0.2.6 vs app/models/lit/source.rb in lit-0.3.0

- old
+ new

@@ -46,16 +46,17 @@ il.localization_key_str = r['localization_key_str'] il.localization_key = LocalizationKey.where(localization_key: il.localization_key_str).first unless il.is_duplicate?(r['value']) il.save! IncommingLocalization.where(id: il.id). - update_all ['translated_value=?', r['value']] + update_all(translated_value: r['value']) end end last_change = get_last_change last_change = DateTime.parse(last_change) unless last_change.nil? touch_last_updated_at(last_change) + update_column(:sync_complete, true) save end end end @@ -87,11 +88,11 @@ req = Net::HTTP::Get.new(uri.request_uri) req.add_field('Authorization', %(Token token="#{api_key}")) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = (uri.port == 443) http.verify_mode = OpenSSL::SSL::VERIFY_NONE - res = http.start do |http| - http.request(req) + res = http.start do |http_started| + http_started.request(req) end if res.is_a?(Net::HTTPSuccess) result = JSON.parse(res.body) end rescue => e