Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

Sunlight specific code

James McKinney edited this page Mar 17, 2014 · 23 revisions
  • You can ignore misc/

app

app/controllers

app/helpers

  • general.rb: item_type_name implements only Sunlight types
  • routing.rb: You can ignore the OpenStates-specific if-statement in item_url
  • subscriptions.rb: You can ignore the Sunlight-specific code

app/models

  • You can ignore ext/
  • Citation: The usc field should be a generic data field
  • Search: You can ignore all the Sunlight-specific code
  • User: You can ignore the :open_states scope

app/views

  • Need to be able to override about.erb and index.erb
  • collections.erb links to a Sunlight training video
  • emails/footers/general.erb includes a description of Sunlight and a call for donations
  • You can ignore emails/footers/open_states.erb and emails/headers/open_states.erb

(The views have not been combed for adapter- or item-specific conditionals.)

config

  • Do not use the files under cron/. See notes below about crontab.rake.

environment.rb:

  • Make the time zone configurable ("America/New_York")

deliveries

  • email.rb: You can ignore the three OpenStates-specific if-statements

public

  • Need to be able to replace BingSiteAuth.xml
  • The sitemap location in robots.txt hardcodes https://scout.sunlightfoundation.com. According to sitemaps.org, it must be an absolute URL, yet StackOverflow uses a relative URL.
  • By configuring the assets section of config.yml, you can change the path to the assets directories

subscriptions

  • manager.rb: You can ignore the Scout User-Agent string
  • All adapters that ship with Scout are Sunlight-specific except for feed.rb. You can ignore them.

tasks

  • analytics.rake: You can ignore the open_states key in the hash.
  • crontab.rake: Don't run the crontab:set task with the environment variable set to production, as it will install Sunlight's crontab.
  • deliver.rake: You can ignore the deliver:custom task.
  • sitemap.rake: Hardcodes the change frequency of Sunlight's item types only, default to weekly otherwise. It should be possible to register item types and set their change frequency. You can ignore the code that adds US Code pages.
  • sunlight.rake: You can ignore.