Fix others additional lints

This commit is contained in:
Artem Chernikov 2014-07-21 14:37:26 +02:00
parent 763f864dc9
commit 056fe5ec3f
18 changed files with 33 additions and 34 deletions

View file

@ -1,7 +1,7 @@
class Ability
include CanCan::Ability
def initialize(user)
def initialize(user) # rubocop:disable Lint/UnusedMethodArgument
# Define abilities for the passed in user here. For example:
#
# user ||= User.new # guest user (not logged in)

View file

@ -639,7 +639,7 @@ class Conference < ActiveRecord::Base
# ====Returns
# * +Fixnum+ -> Progress in Percent
def calculate_setup_progress(result)
(result.select { |k, v| v }.length / result.length.to_f * 100).round(0).to_s
(result.select { |_k, v| v }.length / result.length.to_f * 100).round(0).to_s
end
##

View file

@ -9,7 +9,7 @@ class Datatable
@view = view
end
def as_json(options = {})
def as_json
{
sEcho: params[:sEcho].to_i,
iTotalRecords: @klass.count,
@ -55,10 +55,10 @@ class Datatable
search_for = params[:sSearch].split(' ')
terms = {}
which_one = -1
criteria = search_for.inject([]) do |criteria,atom|
criteria = search_for.inject([]) do |mem, atom|
which_one += 1
terms["search#{which_one}".to_sym] = "%#{atom}%"
criteria << "(#{search_cols.map{|col| "#{col} like :search#{which_one}"}.join(' or ')})"
mem << "(#{search_cols.map{|col| "#{col} like :search#{which_one}"}.join(' or ')})"
end.join(' and ')
[criteria, terms]
end