Fixed rubocop checks.

This commit is contained in:
Martin Edenhofer 2015-08-22 00:40:32 +02:00
parent 21aa91969b
commit e1aae93269
10 changed files with 10 additions and 18 deletions

2
.gitignore vendored
View file

@ -25,8 +25,6 @@
# Ignore local database settings
/config/database.yml
Gemfile.lock
# Ignore mac stuff
.DS_Store

View file

@ -68,7 +68,7 @@ returns
# fallback do sql query
# - stip out * we already search for *query* -
query.gsub! '*', ''
query.delete! '*', ''
organizations = Organization.where(
'name LIKE ? OR note LIKE ?', "%#{query}%", "%#{query}%"
).order('name').limit(limit)

View file

@ -146,7 +146,7 @@ returns
# do query
# - stip out * we already search for *query* -
if query
query.gsub! '*', ''
query.delete! '*', ''
tickets_all = Ticket.select('DISTINCT(tickets.id)')
.where(access_condition)
.where( '( `tickets`.`title` LIKE ? OR `tickets`.`number` LIKE ? OR `ticket_articles`.`body` LIKE ? OR `ticket_articles`.`from` LIKE ? OR `ticket_articles`.`to` LIKE ? OR `ticket_articles`.`subject` LIKE ?)', "%#{query}%", "%#{query}%", "%#{query}%", "%#{query}%", "%#{query}%", "%#{query}%" )

View file

@ -68,7 +68,7 @@ returns
# fallback do sql query
# - stip out * we already search for *query* -
query.gsub! '*', ''
query.delete! '*', ''
if params[:role_ids]
users = User.joins(:roles).where( 'roles.id' => params[:role_ids] ).where(
'(users.firstname LIKE ? or users.lastname LIKE ? or users.email LIKE ?) AND users.id != 1', "%#{query}%", "%#{query}%", "%#{query}%",

View file

@ -120,10 +120,8 @@ class CalendarSubscriptions::Tickets
translated_state = Translation.translate(user_locale, ticket.state.name)
# rubocop:disable Rails/TimeZone
event_data[:dtstart] = Icalendar::Values::DateTime.new( pending_time )
event_data[:dtend] = Icalendar::Values::DateTime.new( pending_time )
# rubocop:enable Rails/TimeZone
event_data[:summary] = "#{translated_state} #{translated_ticket}: '#{ticket.title}'"
event_data[:description] = "T##{ticket.number}"
@ -162,10 +160,8 @@ class CalendarSubscriptions::Tickets
escalation_time = Time.zone.today
end
# rubocop:disable Rails/TimeZone
event_data[:dtstart] = Icalendar::Values::DateTime.new( escalation_time )
event_data[:dtend] = Icalendar::Values::DateTime.new( escalation_time )
# rubocop:enable Rails/TimeZone
event_data[:summary] = "#{translated_ticket_escalation}: '#{ticket.title}'"
event_data[:description] = "T##{ticket.number}"

View file

@ -1,5 +1,3 @@
# rubocop:disable Rails/TimeZone
require 'json'
require 'session_helper'

View file

@ -1,7 +1,7 @@
class Sessions::Backend::Collections::Base
class << self; attr_accessor :model, :roles, :not_roles end
def initialize( user, client = nil, client_id = nil, ttl )
def initialize( user, client, client_id, ttl )
@user = user
@client = client
@client_id = client_id

View file

@ -402,7 +402,8 @@ returns
end
def success?
@success
return true if @success
false
end
end
end

View file

@ -1,6 +1,5 @@
#!/usr/bin/env ruby
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
# rubocop:disable Rails/TimeZone
$LOAD_PATH << './lib'
require 'rubygems'