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.'
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:
Description: 'Enforces consistent use of action filter methods.'
Enabled: false

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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