it-logica-application-backbone 1.3.14 → 1.3.15

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.14
1
+ 1.3.15
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "it-logica-application-backbone"
8
- s.version = "1.3.14"
8
+ s.version = "1.3.15"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ladas"]
12
- s.date = "2013-03-18"
12
+ s.date = "2013-04-23"
13
13
  s.description = "longer description of your gem"
14
14
  s.email = "ladislav.smola@it-logica.cz"
15
15
  s.extra_rdoc_files = [
@@ -427,6 +427,9 @@ module ModelMixins
427
427
  end
428
428
 
429
429
  def filter(object, settings, params, per_page = 10, total_count = nil)
430
+ inactive_columns = get_columns_with_inactive_filter
431
+
432
+
430
433
  order_by = params[:real_order_by]
431
434
 
432
435
  cond_str = ""
@@ -447,6 +450,8 @@ module ModelMixins
447
450
  # filtering by table filters
448
451
  if !params.blank? && params['find']
449
452
  params['find'].each_pair do |i, v|
453
+ next if inactive_columns.include?(i)
454
+
450
455
  i = i.gsub(/___unknown___\./, "") #some cleaning job
451
456
  unless v.blank?
452
457
  if i.match(/^.*?non_existing_column___.*$/i)
@@ -489,6 +494,8 @@ module ModelMixins
489
494
 
490
495
  if !params.blank? && params['find_exact']
491
496
  params['find_exact'].each_pair do |i, v|
497
+ next if inactive_columns.include?(i)
498
+
492
499
  i = i.gsub(/___unknown___\./, "") #some cleaning job
493
500
  unless v.blank?
494
501
  if i.match(/^.*?non_existing_column___.*$/i)
@@ -515,6 +522,8 @@ module ModelMixins
515
522
  # ToDo ladas add having condition to others
516
523
  if !params.blank? && params['multichoice']
517
524
  params['multichoice'].each_pair do |i, v|
525
+ next if inactive_columns.include?(i)
526
+
518
527
  i = i.gsub(/___unknown___\./, "") #some cleaning job
519
528
  unless v.blank?
520
529
  if i.match(/^.*?___sql_expression___.*$/i)
@@ -539,6 +548,8 @@ module ModelMixins
539
548
  from_hash = params['date_from']
540
549
 
541
550
  from_hash.each_pair do |i, v|
551
+ next if inactive_columns.include?(i)
552
+
542
553
  i = i.gsub(/___unknown___\./, "") #some cleaning job
543
554
  unless v.blank?
544
555
  if i.match(/^.*?___sql_expression___.*$/i)
@@ -562,6 +573,8 @@ module ModelMixins
562
573
  to_hash = params['date_to']
563
574
 
564
575
  to_hash.each_pair do |i, v|
576
+ next if inactive_columns.include?(i)
577
+
565
578
  i = i.gsub(/___unknown___\./, "") #some cleaning job
566
579
  unless v.blank?
567
580
  if i.match(/^.*?___sql_expression___.*$/i)
@@ -586,6 +599,8 @@ module ModelMixins
586
599
  from_hash = params['number_from']
587
600
 
588
601
  from_hash.each_pair do |i, v|
602
+ next if inactive_columns.include?(i)
603
+
589
604
  i = i.gsub(/___unknown___\./, "") #some cleaning job
590
605
  unless v.blank?
591
606
  if i.match(/^.*?___sql_expression___.*$/i)
@@ -608,6 +623,8 @@ module ModelMixins
608
623
  to_hash = params['number_to']
609
624
 
610
625
  to_hash.each_pair do |i, v|
626
+ next if inactive_columns.include?(i)
627
+
611
628
  i = i.gsub(/___unknown___\./, "") #some cleaning job
612
629
  unless v.blank?
613
630
  if i.match(/^.*?___sql_expression___.*$/i)
@@ -685,6 +702,15 @@ module ModelMixins
685
702
  ret
686
703
  end
687
704
 
705
+ def get_columns_with_inactive_filter
706
+ inactive_cols = []
707
+ settings[:columns].each do |c|
708
+ if c[:inactive_filter]
709
+ inactive_cols << "#{col[:table]}.#{col[:name]}"
710
+ end
711
+ end
712
+ inactive_cols
713
+ end
688
714
 
689
715
  def check_non_existing_colum_order_by(settings, params)
690
716
  order_by_params = params[:order_by].dup.gsub(/___unknown___\./, "") #some cleaning job
@@ -110,6 +110,11 @@ class TableSettings
110
110
  self
111
111
  end
112
112
 
113
+ # When using the filter box in header but filters in own way, not by table (just passing already filtered AREL to table)
114
+ def inactive_filter(bool = true)
115
+ @column_hash[:inactive_filter] = bool
116
+ self
117
+ end
113
118
  end
114
119
 
115
120
  class CustomColumn < Column
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: it-logica-application-backbone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.14
4
+ version: 1.3.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-18 00:00:00.000000000 Z
12
+ date: 2013-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: htmlentities
16
- requirement: &74739140 !ruby/object:Gem::Requirement
16
+ requirement: &70030660 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *74739140
24
+ version_requirements: *70030660
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: jquery-rails
27
- requirement: &74738140 !ruby/object:Gem::Requirement
27
+ requirement: &70029470 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - =
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.1.3
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *74738140
35
+ version_requirements: *70029470
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: shoulda
38
- requirement: &74736480 !ruby/object:Gem::Requirement
38
+ requirement: &70027830 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *74736480
46
+ version_requirements: *70027830
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rdoc
49
- requirement: &77599400 !ruby/object:Gem::Requirement
49
+ requirement: &73005340 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '3.12'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *77599400
57
+ version_requirements: *73005340
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bundler
60
- requirement: &77598400 !ruby/object:Gem::Requirement
60
+ requirement: &73004400 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.1.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *77598400
68
+ version_requirements: *73004400
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jeweler
71
- requirement: &77597480 !ruby/object:Gem::Requirement
71
+ requirement: &73003530 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 1.8.4
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *77597480
79
+ version_requirements: *73003530
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: simplecov
82
- requirement: &77596530 !ruby/object:Gem::Requirement
82
+ requirement: &73002570 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *77596530
90
+ version_requirements: *73002570
91
91
  description: longer description of your gem
92
92
  email: ladislav.smola@it-logica.cz
93
93
  executables: []
@@ -633,7 +633,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
633
633
  version: '0'
634
634
  segments:
635
635
  - 0
636
- hash: 856536783
636
+ hash: 2123661
637
637
  required_rubygems_version: !ruby/object:Gem::Requirement
638
638
  none: false
639
639
  requirements: