Class: SearchEngine
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- SearchEngine
- Defined in:
- app/models/search_engine.rb
Class Method Summary collapse
Instance Method Summary collapse
- #has_signatory_file? ⇒ Boolean
- #signatory_file_name ⇒ Object
- #signatory_folder ⇒ Object
- #submit ⇒ Object
Class Method Details
.last_submit ⇒ Object
12 13 14 |
# File 'app/models/search_engine.rb', line 12 def last_submit minimum(:submitted_at) end |
.signatory_folder ⇒ Object
22 23 24 |
# File 'app/models/search_engine.rb', line 22 def signatory_folder File.join(Rails.root, 'public') end |
.verify_signatories! ⇒ Object
16 17 18 19 20 |
# File 'app/models/search_engine.rb', line 16 def verify_signatories! all.each do |search_engine| search_engine.send(:create_signatory_file) unless search_engine.has_signatory_file? end end |
Instance Method Details
#has_signatory_file? ⇒ Boolean
41 42 43 |
# File 'app/models/search_engine.rb', line 41 def has_signatory_file? signatory_file_name && File.exists?(signatory_file_name) end |
#signatory_file_name ⇒ Object
37 38 39 |
# File 'app/models/search_engine.rb', line 37 def signatory_file_name verification_file && !verification_file.blank? && File.join(signatory_folder, verification_file ) end |
#signatory_folder ⇒ Object
33 34 35 |
# File 'app/models/search_engine.rb', line 33 def signatory_folder self.class.signatory_folder end |
#submit ⇒ Object
27 28 29 30 31 |
# File 'app/models/search_engine.rb', line 27 def submit if status = Cms::SitemapSubmitter.submit(self) self.update_attributes(:submitted_at => Time.now, :last_status => status) end end |