Class: Iron::GenerateEntryRoutesJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/iron/generate_entry_routes_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(content_type = nil) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'app/jobs/iron/generate_entry_routes_job.rb', line 5

def perform(content_type = nil)
  if content_type
    content_type.entries.where(route: nil).find_each(&:save) if content_type.web_publishing_enabled?
  else
    ContentType.web_published.find_each do |ct|
      ct.entries.where(route: nil).find_each(&:save)
    end
  end
end