spud_inquiries 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,12 +28,15 @@ private
28
28
  if defined? Spud::Cms::Engine #Is CMS Being Used?
29
29
  values = [record.name]
30
30
  values << @old_name if !@old_name.blank?
31
- SpudPageLiquidTag.where(:tag_name => "inquiry",:value => values).includes(:spud_page_partial).each do |tag|
32
- partial = tag.spud_page_partial
31
+ SpudPageLiquidTag.where(:tag_name => "inquiry",:value => values).includes(:attachment).each do |tag|
32
+ partial = tag.attachment
33
33
  partial.postprocess_content
34
34
  partial.save
35
- partial.spud_page.updated_at = Time.now.utc
36
- partial.spud_page.save
35
+ page = partial.try(:spud_page)
36
+ if page.blank? == false
37
+ page.updated_at = Time.now.utc
38
+ page.save
39
+ end
37
40
  end
38
41
 
39
42
  end
@@ -1,5 +1,5 @@
1
1
  module Spud
2
2
  module Inquiries
3
- VERSION = "0.9.0"
3
+ VERSION = "0.9.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spud_inquiries
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-15 00:00:00.000000000 Z
12
+ date: 2012-11-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -209,7 +209,6 @@ files:
209
209
  - app/models/spud_inquiry_field.rb
210
210
  - app/models/spud_inquiry_form.rb
211
211
  - app/models/spud_inquiry_form_field.rb
212
- - app/observers/inquiry_observer.rb
213
212
  - app/observers/inquiry_sweeper.rb
214
213
  - app/views/contacts/_show.html.erb
215
214
  - app/views/contacts/show.html.erb
@@ -295,7 +294,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
295
294
  version: '0'
296
295
  segments:
297
296
  - 0
298
- hash: -1072372052212535392
297
+ hash: 3985571689539372379
299
298
  required_rubygems_version: !ruby/object:Gem::Requirement
300
299
  none: false
301
300
  requirements:
@@ -304,7 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
303
  version: '0'
305
304
  segments:
306
305
  - 0
307
- hash: -1072372052212535392
306
+ hash: 3985571689539372379
308
307
  requirements: []
309
308
  rubyforge_project:
310
309
  rubygems_version: 1.8.24
@@ -1,43 +0,0 @@
1
- class InquiryObserver < ActiveRecord::Observer
2
- observe :spud_inquiry_form,:spud_inquiry_form_field
3
-
4
- def before_save(record)
5
- if record.is_a?(SpudInquiryForm)
6
- @old_name = record.name_was
7
- else
8
- @old_name = nil
9
- end
10
- end
11
-
12
- def after_save(record)
13
- if record.is_a?(SpudInquiryFormField)
14
- reset_cms_pages(record.spud_inquiry_form)
15
- else
16
- reset_cms_pages(record)
17
- end
18
- end
19
- def after_destroy(record)
20
- if record.is_a?(SpudInquiryFormField)
21
- reset_cms_pages(record.spud_inquiry_form)
22
- else
23
- reset_cms_pages(record)
24
- end
25
- end
26
- private
27
- def reset_cms_pages(record)
28
- if SpudPageLiquidTag
29
- values = [record.name]
30
- values << @old_name if !@old_name.blank?
31
- SpudPageLiquidTag.where(:tag_name => "inquiry",:value => values).includes(:spud_page_partial).each do |tag|
32
- partial = tag.spud_page_partial
33
- partial.postprocess_content
34
- partial.save
35
- partial.spud_page.updated_at = Time.now.utc
36
- partial.spud_page.save
37
- end
38
-
39
- end
40
- end
41
-
42
-
43
- end