added email prefs model
added email prefs controller
updated email prefs
tested email preferences
added users controller
added subscription controller
followed book funky ness
the rest of the controllers
updated subscription_controller
subscription controller
remove arguemenst from find_subscription_id

also move it into books helper
Merge pull request #1 from nbirnel/email

remove arguements from find_subscription_id
updated email
pull out ratyrate junk

*   gem 'ratyrate'                      #star ratings
bundle install
bundle update

not yet, might need later:
;    git rm 'app/assets/images/big-star.png'
;    git rm 'app/assets/images/cancel-off.png'
;    git rm 'app/assets/images/cancel-on.png'
;    git rm 'app/assets/images/mid-star.png'
;    git rm 'app/assets/images/star-half.png'
;    git rm 'app/assets/images/star-off.png'
;    git rm 'app/assets/images/star-on.png'
;    git rm 'app/assets/javascripts/jquery.raty.js'
;    git rm 'app/assets/javascripts/ratyrate.js.erb'

git rm 'app/controllers/rater_controller.rb'
git rm 'app/models/average_cache.rb'
git rm 'app/models/overall_average.rb'
git rm 'app/models/rate.rb'
git rm 'app/models/rating_cache.rb'

    *   class Book: ratyrate_rateable 'rating'
    *   class User: ratyrate_rater
    *   book index: %td= rating_for book, 'rating'
    *   book index: %th = "Rating"
    *   book show: = rating_for @book, "rating"
    *   config/routes: post '/rate' => 'rater#create', :as => 'rate'

undo a bunch of migrations:
    for i in overall_averages average_caches rates rating_caches; do rails g migration drop-$i; done
    for i in overall_averages average_caches rates rating_caches; do vim -O db/migrate/*create_$i.rb db/migrate/*drop-$i.rb; done
    reverse up and down from old tables
    rake db:migrate
    rm db/*sqlite3
    rake db:setup
    rake db:seed
change 'Owner ID' to 'Added by' in books index
make some seed and gui improvements

app/views/authors/index.html.haml
app/views/authors/show.html.haml
app/views/books/index.html.haml
app/views/books/show.html.haml
  crosslink where possible and sensible
  change title headers to sane ones

db/seeds.rb
  correct the mismatched tags with books in seed
try the rating owen is using

gem 'jquery-raty-rails', github: 'emaiax/jquery-raty-rails' #rate
bundle install
require jquery-raty-rails in application.js
lots more to do!
get (bad) rating logic in

app/controllers/application_controller.rb
    improve indents
app/controllers/reviews_controller.rb
    set book before methods
    add rating to params
app/models/book.rb
    def update_rating!
app/models/review.rb
    validate rating
    update_book_rating
app/views/books/show.html.haml
    = @book.rating
app/views/reviews/_form.html.haml
    = render 'rating_stars.html.haml', review: @review, book: @book
app/views/reviews/_rating_stars.html.haml
    user_star
app/views/reviews/index.html.haml
    improve title headings
    %td= review.rating
app/views/reviews/show.html.haml
    = @review.rating
app/views/shared/_average_stars.html.haml
    I don't understand this bit
db/migrate/20140828220002_add_rating_to_reviews.rb
    add_column :reviews, :rating, :integer
db/migrate/20140828220011_add_rating_to_books.rb
    add_column :books, :rating, :float
db/schema.rb
    remove the ratyrate stuff from schema
spec/controllers/reviews_controller_spec.rb
    add valid attribute rating
add sort rating, close (#25), reopen (#4)(#5)(#6)

So this breaks the ratings we had.
But... the logic is there for ratings.
It is the UI which is missing.
So I would like to merge this in.
It does break 4 reviewscontroller tests, but we shall see how that works
with master.

app/controllers/books_controller.rb
    default sort in rating
app/controllers/reviews_controller.rb
    add sort_column helper method
app/helpers/books_helper.rb
    def avg_rating_view
app/helpers/reviews_helper.rb
    def rating_view review
app/models/book.rb
   def update_rating!
app/views/books/index.html.haml
      %th= sortable "rating"
        %td= rating_view book
app/views/books/show.html.haml
   = avg_rating_view @book
app/views/reviews/_form.html.haml
      ~#= render 'rating_stars.html.haml', review: @review, book: @book
      = number_field_tag 'quantity', nil, in: 1...5
      FIXME this doesn't work!
app/views/reviews/index.html.haml
    use lc field headers
app/views/reviews/show.html.haml
  = rating_view @review
spec/features/books_spec.rb
  describe 'Showing' do
    describe 'an unrated book' do
      it 'shows no ratings' do
oops!