discerner 2.0.9 → 2.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGI4MzE2NjJiMzNhZWQyOTdjZTJhOWM0YzBkMGVmN2FjN2ZiODVjMg==
4
+ NzMxZmQzMjg2YmRmNmFjY2ZkZDE2NzFmZjJkZjNjMjNmOTg5MDkzNA==
5
5
  data.tar.gz: !binary |-
6
- NWE2ZTc0ZjhhNGQ4YjE4ZTQ0Yjc5MjI1ZGI3NGY3YjQxMWFhODcxZQ==
6
+ MDNiZjQ3NzYwOGVmOWNmNjUxYTAyMjE0OGY2YTJmODY1MWNiZDdiZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NGFkNmZhNmE5MDRkNzQ3ZTQwODBkODVhODhhMzI4NDJkOTVhMzYxZTFiZWEx
10
- YTkxNTY0MDFlMmMwNjZhOTliNzgzM2FmNWY3MWY0ODYxNWQyMTkyYzRhODkw
11
- ODhiNDIwZThmOThhYjBhZjJmZWU1YmRjNjY2YTIzMzUzM2Q2NzE=
9
+ NTM1YTgwN2E3NzM5OGYwNzM2ZTRiMmEzMWJlZWY1NzM3ZWIzNjliMDk0M2Ex
10
+ ZTJhOTE4MDJiNGQwYzMzYWFmNGQ0NWQxYmQwYmYxYTlhODk0MjgzMDdjYWIw
11
+ YWMzNWRhNmMyMzZiMzNlYmM2OTRlZmZkM2FkZjViMDU2ZjgwNjE=
12
12
  data.tar.gz: !binary |-
13
- NjEyN2Y3N2Q1YjM2NTE0MzA4Njk1NzVhZjcwYjg5ZjZmYzgzYzgzZTg3MTc0
14
- NjM4ZDRiZWUxMzY2ZDc4OTIwZDFmOTg1ZWUzYjdhODg4MWEwM2E4YjIyZTJk
15
- YWZhYmY0MWQyNjY2ZWFmOTBhYjRmNWE5MTBiMWJlNGQ1ZWFjNTg=
13
+ OWRlZDU2ZDY5OTg4NGQ3YzA2NmU0ZTE4NmNjODQ4ZTdiNzgzYzUzNTJkYzNk
14
+ MDExYmJiNmMwNTc3YTRkYzE2NDZiYWQzMDAzZmM0NTI1OWZkYWMxYWFlMDcz
15
+ YmI4ZjFiYTRiNjM0YzVlOGEyNWU5NmMxZDE2ZGYxNzU5OTViNDc=
@@ -1,4 +1,4 @@
1
- = image_tag asset_path('discerner/ajax-loader.gif'), class: 'discerner-spinner hide'
1
+ = image_tag 'discerner/ajax-loader.gif', class: 'discerner-spinner hide'
2
2
  - unless @discerner_search.blank?
3
3
  = render 'discerner/shared/error_messages', object: @discerner_search
4
4
 
@@ -24,6 +24,7 @@ module Discerner
24
24
 
25
25
  # Hooks
26
26
  base.send :after_commit, :update_associations, on: :update, if: Proc.new { |record| record.previous_changes.include?('deleted_at') }
27
+ base.send :after_commit, :mark_search_updated
27
28
  end
28
29
 
29
30
  # Instance Methods
@@ -110,8 +111,6 @@ module Discerner
110
111
  end
111
112
  end
112
113
 
113
-
114
-
115
114
  private
116
115
  def update_associations
117
116
  search_parameter_values.each do |r|
@@ -119,6 +118,13 @@ module Discerner
119
118
  r.save
120
119
  end
121
120
  end
121
+
122
+ def mark_search_updated
123
+ if (self.destroyed? || !previous_changes.empty?) && search
124
+ search.updated_at = Time.now
125
+ search.save!
126
+ end
127
+ end
122
128
  end
123
129
  end
124
130
  end
@@ -22,6 +22,7 @@ module Discerner
22
22
  # Hooks
23
23
  base.send :before_validation, :cleanup_parameter_values
24
24
  base.send :after_commit, :destroy_if_deleted_parameter_value, on: :update
25
+ base.send :after_commit, :mark_search_updated
25
26
  end
26
27
 
27
28
  # Instance Methods
@@ -121,6 +122,13 @@ module Discerner
121
122
  errors.add(:base, "Operator has to be selected for parameter values that do not belong to list or combobox") if operator.blank?
122
123
  end
123
124
  end
125
+
126
+ def mark_search_updated
127
+ if (self.destroyed? || !previous_changes.empty?) && search_parameter && search_parameter.search
128
+ search_parameter.search.updated_at = Time.now
129
+ search_parameter.search.save!
130
+ end
131
+ end
124
132
  end
125
133
  end
126
134
  end
@@ -1,3 +1,3 @@
1
1
  module Discerner
2
- VERSION = "2.0.9"
2
+ VERSION = "2.0.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discerner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.9
4
+ version: 2.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Gurley, Yulia Bushmanova
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-29 00:00:00.000000000 Z
11
+ date: 2015-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails