Class: SpudInquiryForm
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- SpudInquiryForm
- Defined in:
- app/models/spud_inquiry_form.rb
Instance Method Summary collapse
- #expire_cache ⇒ Object
-
#generate_url_name ⇒ Object
attr_accessible :name,:url_name,:recipients,:content,:subject,:spud_inquiry_form_fields_attributes, :created_at, :updated_at, :thank_you_content, :submit_title.
Instance Method Details
#expire_cache ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/models/spud_inquiry_form.rb', line 21 def expire_cache if !defined?(SpudPageLiquidTag) return end # Now Time to Update Parent Entries old_name = self.name_was values = [self.name] values << old_name if !old_name.blank? SpudPageLiquidTag.where(:tag_name => "inquiry",:value => values).includes(:attachment).each do |tag| partial = tag.touch end end |
#generate_url_name ⇒ Object
attr_accessible :name,:url_name,:recipients,:content,:subject,:spud_inquiry_form_fields_attributes, :created_at, :updated_at, :thank_you_content, :submit_title
15 16 17 18 19 |
# File 'app/models/spud_inquiry_form.rb', line 15 def generate_url_name if !self.name.blank? self.url_name = self.name.gsub(/[^a-zA-Z0-9\ ]/," ").gsub(/\ \ +/," ").gsub(/\ /,"-").downcase end end |