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
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!
make ratings work from gui

app/helpers/books_helper.rb
    render boot-rating average to 2 decimal
app/models/review.rb
    after_update :update_book_rating
app/views/reviews/_form.html.haml
    use form_for number_field
improve review and ratings

app/controllers/reviews_controller.rb
    check that book is reviewable, etc
app/models/review.rb
  def reviewer
app/views/reviews/index.html.haml
        %td= review.reviewer.email
        check that you own review before displaying action buttons
app/views/reviews/show.html.haml
    tidy code, using review.reviewer
comment out a bunch of un-needed tests
remove ratyrate.js.erb, which pisses off travis
Merge branch 'emaiax-jquery-raty-rails' of https://github.com/nbirnel/Library-Application into nbirnel-emaiax-jquery-raty-rails

Conflicts:
	app/views/books/index.html.haml
	app/views/books/show.html.haml
Merge branch 'nbirnel-emaiax-jquery-raty-rails'