File tree Expand file tree Collapse file tree 4 files changed +19
-18
lines changed
Expand file tree Collapse file tree 4 files changed +19
-18
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ require :
3+ - rubocop-performance
4+ - rubocop-rake
5+ - rubocop-rspec
6+ - rubocop-rspec_rails
7+
18AllCops :
29 NewCops : enable
3- SuggestExtensions : false
410 TargetRubyVersion : ' 3.0'
511 Exclude :
612 - bin/*
7-
8- Gemspec/DevelopmentDependencies :
9- Enabled : false
13+ - lib/datatables-factory.rb
1014
1115Gemspec/RequireMFA :
1216 Enabled : false
@@ -57,13 +61,6 @@ Layout/HashAlignment:
5761Metrics/MethodLength :
5862 Max : 12
5963
60- Metrics/ModuleLength :
61- Max : 140
64+ Metrics/ClassLength :
65+ Max : 110
6266
63- # #########
64- # NAMING #
65- # #########
66-
67- Naming/FileName :
68- Exclude :
69- - lib/datatables-factory.rb
Original file line number Diff line number Diff line change @@ -10,5 +10,9 @@ gem 'pry'
1010gem 'rake'
1111gem 'rspec-rails'
1212gem 'rubocop'
13+ gem 'rubocop-performance'
14+ gem 'rubocop-rake'
15+ gem 'rubocop-rspec'
16+ gem 'rubocop-rspec_rails'
1317gem 'simplecov'
1418gem 'sqlite3' , '~> 1.5.0'
Original file line number Diff line number Diff line change @@ -52,8 +52,8 @@ def search_form(options = {}, &block)
5252 options [ :html ] ||= { }
5353 options [ :html ] [ :role ] ||= 'form'
5454 options [ :layout ] ||= :horizontal
55- options [ :acts_like_form_tag ] = true
56- options [ :datatable ] = self
55+ options [ :acts_like_form_tag ] = true
56+ options [ :datatable ] = self
5757
5858 layout = "form-#{ options [ :layout ] } "
5959 options [ :html ] [ :class ] = [ options [ :html ] [ :class ] , layout ] . compact . join ( ' ' )
@@ -106,7 +106,7 @@ def datatable_id
106106
107107
108108 def final_namespace
109- @final_namespace ||= @namespace . prepend ( :datatables ) . map ( & : to_s) . map ( & : camelize)
109+ @final_namespace ||= @namespace . prepend ( :datatables ) . map { | x | x . to_s . camelize }
110110 end
111111
112112
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ def datatable_options_for_range_date
4747
4848 def label_filter_by ( label , prefix : true )
4949 label = t ( "datatables.filter.#{ label } " )
50- label = prefix ? label . downcase : label
50+ label = label . downcase if prefix
5151 prefix = prefix ? "#{ t ( 'text.filter_by' ) } " : ''
5252 "#{ prefix } #{ label } "
5353 end
@@ -80,7 +80,7 @@ def datatables_translations
8080 rows : t ( 'datatables.select.rows' ) ,
8181 } ,
8282 buttons : {
83- pageLength : {
83+ pageLength : {
8484 _ : t ( 'datatables.buttons.pageLength._' ) ,
8585 '-1' : t ( 'datatables.buttons.pageLength.-1' ) ,
8686 } ,
You can’t perform that action at this time.
0 commit comments