Corrected with rubocop cop 'Style/EmptyLineBetweenDefs'.

This commit is contained in:
Thorsten Eckel 2015-05-07 12:27:12 +02:00
parent fc5e3696a2
commit a5a215b774
27 changed files with 39 additions and 5 deletions

View file

@ -173,11 +173,6 @@ Style/Documentation:
Description: 'Document classes and non-namespace modules.' Description: 'Document classes and non-namespace modules.'
Enabled: false Enabled: false
Style/EmptyLineBetweenDefs:
Description: 'Use empty lines between defs.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
Enabled: false
Rails/ActionFilter: Rails/ActionFilter:
Description: 'Enforces consistent use of action filter methods.' Description: 'Enforces consistent use of action filter methods.'
Enabled: false Enabled: false

View file

@ -64,6 +64,7 @@ class ApplicationController < ActionController::Base
return if !session[:user_id] return if !session[:user_id]
@_current_user = User.find( session[:user_id] ) @_current_user = User.find( session[:user_id] )
end end
def current_user_set(user) def current_user_set(user)
session[:user_id] = user.id session[:user_id] = user.id
@_current_user = user @_current_user = user
@ -298,6 +299,7 @@ class ApplicationController < ActionController::Base
logger.error e.backtrace.inspect logger.error e.backtrace.inspect
render json: { error: e.message }, status: :unprocessable_entity render json: { error: e.message }, status: :unprocessable_entity
end end
def model_create_render_item (generic_object) def model_create_render_item (generic_object)
render json: generic_object.attributes_with_associations, status: :created render json: generic_object.attributes_with_associations, status: :created
end end
@ -319,6 +321,7 @@ class ApplicationController < ActionController::Base
logger.error e.backtrace.inspect logger.error e.backtrace.inspect
render json: { error: e.message }, status: :unprocessable_entity render json: { error: e.message }, status: :unprocessable_entity
end end
def model_update_render_item (generic_object) def model_update_render_item (generic_object)
render json: generic_object.attributes_with_associations, status: :ok render json: generic_object.attributes_with_associations, status: :ok
end end
@ -332,6 +335,7 @@ class ApplicationController < ActionController::Base
logger.error e.backtrace.inspect logger.error e.backtrace.inspect
render json: { error: e.message }, status: :unprocessable_entity render json: { error: e.message }, status: :unprocessable_entity
end end
def model_destory_render_item () def model_destory_render_item ()
render json: {}, status: :ok render json: {}, status: :ok
end end
@ -351,6 +355,7 @@ class ApplicationController < ActionController::Base
logger.error e.backtrace.inspect logger.error e.backtrace.inspect
render json: { error: e.message }, status: :unprocessable_entity render json: { error: e.message }, status: :unprocessable_entity
end end
def model_show_render_item (generic_object) def model_show_render_item (generic_object)
render json: generic_object.attributes_with_associations, status: :ok render json: generic_object.attributes_with_associations, status: :ok
end end
@ -363,6 +368,7 @@ class ApplicationController < ActionController::Base
logger.error e.backtrace.inspect logger.error e.backtrace.inspect
render json: { error: e.message }, status: :unprocessable_entity render json: { error: e.message }, status: :unprocessable_entity
end end
def model_index_render_result (generic_objects) def model_index_render_result (generic_objects)
render json: generic_objects, status: :ok render json: generic_objects, status: :ok
end end

View file

@ -459,6 +459,7 @@ end
def latest_change_set_from_observer def latest_change_set_from_observer
self.class.latest_change_set(self.updated_at) self.class.latest_change_set(self.updated_at)
end end
def latest_change_set_from_observer_destroy def latest_change_set_from_observer_destroy
self.class.latest_change_set(nil) self.class.latest_change_set(nil)
end end
@ -1030,6 +1031,7 @@ get assets of object list
def attachments_buffer def attachments_buffer
@attachments_buffer_data @attachments_buffer_data
end end
def attachments_buffer=(attachments) def attachments_buffer=(attachments)
@attachments_buffer_data = attachments @attachments_buffer_data = attachments
end end

View file

@ -6,9 +6,11 @@ class Observer::Organization::RefObjectTouch < ActiveRecord::Observer
def after_create(record) def after_create(record)
ref_object_touch(record) ref_object_touch(record)
end end
def after_update(record) def after_update(record)
ref_object_touch(record) ref_object_touch(record)
end end
def after_destroy(record) def after_destroy(record)
ref_object_touch(record) ref_object_touch(record)
end end

View file

@ -8,6 +8,7 @@ class Observer::Session < ActiveRecord::Observer
def before_create(record) def before_create(record)
check(record) check(record)
end end
def before_update(record) def before_update(record)
check(record) check(record)
end end

View file

@ -19,6 +19,7 @@ class Observer::Tag::TicketHistory < ActiveRecord::Observer
value_to: record.tag_item.name, value_to: record.tag_item.name,
) )
end end
def after_destroy(record) def after_destroy(record)
# just process ticket object tags # just process ticket object tags

View file

@ -2,6 +2,7 @@ class Observer::Ticket::Article::CommunicateEmail::BackgroundJob
def initialize(id) def initialize(id)
@article_id = id @article_id = id
end end
def perform def perform
record = Ticket::Article.find( @article_id ) record = Ticket::Article.find( @article_id )

View file

@ -4,6 +4,7 @@ class Observer::Ticket::Notification::BackgroundJob
def initialize(params) def initialize(params)
@p = params @p = params
end end
def perform def perform
ticket = Ticket.find(@p[:ticket_id]) ticket = Ticket.find(@p[:ticket_id])
if @p[:article_id] if @p[:article_id]

View file

@ -2,6 +2,7 @@ class Observer::Ticket::OnlineNotificationSeen::BackgroundJob
def initialize(id) def initialize(id)
@ticket_id = id @ticket_id = id
end end
def perform def perform
# set all online notifications to seen # set all online notifications to seen

View file

@ -6,9 +6,11 @@ class Observer::Ticket::RefObjectTouch < ActiveRecord::Observer
def after_create(record) def after_create(record)
ref_object_touch(record) ref_object_touch(record)
end end
def after_update(record) def after_update(record)
ref_object_touch(record) ref_object_touch(record)
end end
def after_destroy(record) def after_destroy(record)
ref_object_touch(record) ref_object_touch(record)
end end

View file

@ -6,6 +6,7 @@ class Observer::Ticket::UserTicketCounter < ActiveRecord::Observer
def after_create(record) def after_create(record)
user_ticket_counter_update(record) user_ticket_counter_update(record)
end end
def after_update(record) def after_update(record)
user_ticket_counter_update(record) user_ticket_counter_update(record)
end end

View file

@ -2,6 +2,7 @@ class Observer::Ticket::UserTicketCounter::BackgroundJob
def initialize(id) def initialize(id)
@customer_id = id @customer_id = id
end end
def perform def perform
# open ticket count # open ticket count

View file

@ -6,6 +6,7 @@ class Observer::User::Geo < ActiveRecord::Observer
def before_create(record) def before_create(record)
check_geo(record) check_geo(record)
end end
def before_update(record) def before_update(record)
check_geo(record) check_geo(record)
end end

View file

@ -6,9 +6,11 @@ class Observer::User::RefObjectTouch < ActiveRecord::Observer
def after_create(record) def after_create(record)
ref_object_touch(record) ref_object_touch(record)
end end
def after_update(record) def after_update(record)
ref_object_touch(record) ref_object_touch(record)
end end
def after_destroy(record) def after_destroy(record)
ref_object_touch(record) ref_object_touch(record)
end end

View file

@ -6,6 +6,7 @@ class Observer::User::TicketOrganization < ActiveRecord::Observer
def after_create(record) def after_create(record)
check_organization(record) check_organization(record)
end end
def after_update(record) def after_update(record)
check_organization(record) check_organization(record)
end end

View file

@ -56,9 +56,11 @@ class Setting < ApplicationModel
def delete_cache def delete_cache
@@current[:settings_config] = nil @@current[:settings_config] = nil
end end
def set_initial def set_initial
self.state_initial = self.state self.state_initial = self.state
end end
def state_check def state_check
return if !(self.state || self.state == false) return if !(self.state || self.state == false)

View file

@ -11,6 +11,7 @@ class Taskbar < ApplicationModel
def update_last_contact def update_last_contact
self.last_contact = Time.now self.last_contact = Time.now
end end
def set_user def set_user
self.user_id = UserInfo.current_user_id self.user_id = UserInfo.current_user_id
end end

View file

@ -172,6 +172,7 @@ translate strings in ruby context, e. g. for notifications
return if target_initial return if target_initial
self.target_initial = self.target self.target_initial = self.target
end end
def cache_clear def cache_clear
Cache.delete( 'Translation::' + self.locale.downcase ) Cache.delete( 'Translation::' + self.locale.downcase )
end end

View file

@ -3,6 +3,7 @@ class UpdateSession < ActiveRecord::Migration
add_column :sessions, :request_type, :integer, null: true add_column :sessions, :request_type, :integer, null: true
add_index :sessions, :request_type add_index :sessions, :request_type
end end
def down def down
end end
end end

View file

@ -28,6 +28,7 @@ class UpdateTicketNumber < ActiveRecord::Migration
frontend: false frontend: false
) )
end end
def down def down
end end
end end

View file

@ -47,6 +47,7 @@ class UpdateAuth < ActiveRecord::Migration
frontend: false frontend: false
) )
end end
def down def down
end end
end end

View file

@ -53,6 +53,7 @@ class AddSearchIndex < ActiveRecord::Migration
User.search_index_reload User.search_index_reload
Organization.search_index_reload Organization.search_index_reload
end end
def down def down
end end
end end

View file

@ -2,6 +2,7 @@ class RenameAvatarTypo < ActiveRecord::Migration
def up def up
rename_column :avatars, :inital, :initial rename_column :avatars, :inital, :initial
end end
def down def down
rename_column :avatars, :initial, :inital rename_column :avatars, :initial, :inital
end end

View file

@ -7,6 +7,7 @@ class Class
.tr('-', '_') .tr('-', '_')
.downcase .downcase
end end
def to_app_model def to_app_model
camel_cased_word = self.to_s camel_cased_word = self.to_s
camel_cased_word.gsub(/::/, '').to_sym camel_cased_word.gsub(/::/, '').to_sym

View file

@ -7,6 +7,7 @@ class String
end end
body_quote body_quote
end end
def word_wrap(*args) def word_wrap(*args)
options = args.extract_options! options = args.extract_options!
unless args.blank? unless args.blank?

View file

@ -11,6 +11,7 @@ class AAbUnitTest < TestCase
value: '0', value: '0',
) )
end end
def test_ui def test_ui
@browser = browser_instance @browser = browser_instance
location( url: browser_url + '/tests-ui' ) location( url: browser_url + '/tests-ui' )
@ -34,6 +35,7 @@ class AAbUnitTest < TestCase
value: '0', value: '0',
) )
end end
def test_form def test_form
@browser = browser_instance @browser = browser_instance
location( url: browser_url + '/tests-form' ) location( url: browser_url + '/tests-form' )
@ -57,6 +59,7 @@ class AAbUnitTest < TestCase
value: '0', value: '0',
) )
end end
def test_table def test_table
@browser = browser_instance @browser = browser_instance
location( url: browser_url + '/tests-table' ) location( url: browser_url + '/tests-table' )

View file

@ -20,6 +20,7 @@ class TaskbarTaskTest < TestCase
) )
sleep 10 sleep 10
end end
def test_persistant_task_b def test_persistant_task_b
@browser = browser_instance @browser = browser_instance
login( login(
@ -41,6 +42,7 @@ class TaskbarTaskTest < TestCase
exists_not( css: '.active .newTicket input[name="title"]' ) exists_not( css: '.active .newTicket input[name="title"]' )
end end
def test_persistant_task_with_relogin def test_persistant_task_with_relogin
@browser = browser_instance @browser = browser_instance
login( login(