acts_as_starrable 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,22 @@
1
+ # ActsAsStarrable
2
+
3
+ `ActsAsStarrable` is a Rails Engine that allows you to easily add ratings (stars) to your models. Being an engine, it's a full-service add-on, providing views and controllers with sane defaults that will work for most use cases. In cases where it won't work, these can be easily overridden.
4
+
5
+ To install ActsAsStarrable, add `acts_as_starrable` to your Gemfile and run `bundle install`.
6
+
7
+ The ratings model can be built by running the following:
8
+
9
+ rails g acts_as_starrable:migration
10
+ rake db:migrate
11
+
12
+ Ratings can be added to a model as follows:
13
+
14
+ class Foo < ActiveRecord::Base
15
+ acts_as_starrable
16
+ end
17
+
18
+ Finally, use the `stars` helper method in your view to display the partial:
19
+
20
+ <%= stars(@foo) %>
21
+
22
+ `ActsAsStarrable` uses the [RateIt](http://rateit.codeplex.com) jQuery plugin and conforms to the [schema.org](http://schema.org) [Rating](http://schema.org/Rating) and [AggregateRating](http://schema.org/AggregateRating) schemata for SEO goodness.
@@ -1,2 +1,7 @@
1
- (function(n){function t(n){var u=n.originalEvent.changedTouches,t=u[0],i="",r;switch(n.type){case"touchmove":i="mousemove";break;case"touchend":i="mouseup";break;default:return}r=document.createEvent("MouseEvent"),r.initMouseEvent(i,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(r),n.preventDefault()}n.rateit={aria:{resetLabel:"reset rating",ratingLabel:"rating"}},n.fn.rateit=function(i,r){var e=1,u={},o="init",s=function(n){return n.charAt(0).toUpperCase()+n.substr(1)},f;if(this.length==0)return this;if(f=n.type(i),f=="object"||i===undefined||i==null)u=n.extend({},n.fn.rateit.defaults,i);else{if(f=="string"&&r===undefined)return this.data("rateit"+s(i));f=="string"&&(o="setvalue")}return this.each(function(){var c=n(this),f=function(n,t){if(t!=null){var i="aria-value"+(n=="value"?"now":n),r=c.find(".rateit-range");r.attr(i)!=undefined&&r.attr(i,t)}return arguments[0]="rateit"+s(n),c.data.apply(c,arguments)},v,h,b,k,l,y,p,a;if(c.hasClass("rateit")||c.addClass("rateit"),v=c.css("direction")!="rtl",o=="setvalue"){if(!f("init"))throw"Can't set value before init";i!="readonly"||r!=!0||f("readonly")||(c.find(".rateit-range").unbind(),f("wired",!1)),i=="value"&&(r=r==null?f("min"):Math.max(f("min"),Math.min(f("max"),r))),f("backingfld")&&(h=n(f("backingfld")),i=="value"&&h.val(r),i=="min"&&h[0].min&&(h[0].min=r),i=="max"&&h[0].max&&(h[0].max=r),i=="step"&&h[0].step&&(h[0].step=r)),f(i,r)}f("init")||(f("min",f("min")||u.min),f("max",f("max")||u.max),f("step",f("step")||u.step),f("readonly",f("readonly")!==undefined?f("readonly"):u.readonly),f("resetable",f("resetable")!==undefined?f("resetable"):u.resetable),f("backingfld",f("backingfld")||u.backingfld),f("starwidth",f("starwidth")||u.starwidth),f("starheight",f("starheight")||u.starheight),f("value",Math.max(f("min"),Math.min(f("max"),f("value")||u.value||u.min))),f("ispreset",f("ispreset")!==undefined?f("ispreset"):u.ispreset),f("backingfld")&&(h=n(f("backingfld")),f("value",h.hide().val()),(h.attr("disabled")||h.attr("readonly"))&&f("readonly",!0),h[0].nodeName=="INPUT"&&(h[0].type=="range"||h[0].type=="text")&&(f("min",parseInt(h.attr("min"))||f("min")),f("max",parseInt(h.attr("max"))||f("max")),f("step",parseInt(h.attr("step"))||f("step"))),h[0].nodeName=="SELECT"&&h[0].options.length>1&&(f("min",Number(h[0].options[0].value)),f("max",Number(h[0].options[h[0].length-1].value)),f("step",Number(h[0].options[1].value)-Number(h[0].options[0].value)))),b=c[0].nodeName=="DIV"?"div":"span",e++,k='<button id="rateit-reset-{{index}}" class="rateit-reset" aria-label="'+n.rateit.aria.resetLabel+'" aria-controls="rateit-range-{{index}}"><\/button><{{element}} id="rateit-range-{{index}}" class="rateit-range" tabindex="0" role="slider" aria-label="'+n.rateit.aria.ratingLabel+'" aria-owns="rateit-reset-{{index}}" aria-valuemin="'+f("min")+'" aria-valuemax="'+f("max")+'" aria-valuenow="'+f("value")+'"><{{element}} class="rateit-selected" style="height:'+f("starheight")+'px"><\/{{element}}><{{element}} class="rateit-hover" style="height:'+f("starheight")+'px"><\/{{element}}><\/{{element}}>',c.append(k.replace(/{{index}}/gi,e).replace(/{{element}}/gi,b)),v||(c.find(".rateit-reset").css("float","right"),c.find(".rateit-selected").addClass("rateit-selected-rtl"),c.find(".rateit-hover").addClass("rateit-hover-rtl")),f("init",!0)),l=c.find(".rateit-range"),l.width(f("starwidth")*(f("max")-f("min"))).height(f("starheight")),y="rateit-preset"+(v?"":"-rtl"),f("ispreset")?c.find(".rateit-selected").addClass(y):c.find(".rateit-selected").removeClass(y),f("value")!=null&&(p=(f("value")-f("min"))*f("starwidth"),c.find(".rateit-selected").width(p)),a=c.find(".rateit-reset"),a.data("wired")!==!0&&a.bind("click",function(t){t.preventDefault(),a.blur(),f("value",f("min")),l.find(".rateit-hover").hide().width(0),l.find(".rateit-selected").width(0).show(),f("backingfld")&&n(f("backingfld")).val(f("min")),c.trigger("reset")}).data("wired",!0);var d=function(t,i){var u=i.changedTouches?i.changedTouches[0].pageX:i.pageX,r=u-n(t).offset().left;return v||(r=l.width()-r),r>l.width()&&(r=l.width()),r<0&&(r=0),p=Math.ceil(r/f("starwidth")*(1/f("step")))},g=function(n){var t=n*f("starwidth")*f("step"),r=l.find(".rateit-hover"),i;r.data("width")!=t&&(l.find(".rateit-selected").hide(),r.width(t).show().data("width",t),i=[n*f("step")+f("min")],c.trigger("hover",i).trigger("over",i))},w=function(t){f("value",t),f("backingfld")&&n(f("backingfld")).val(t),f("ispreset")&&(l.find(".rateit-selected").removeClass(y),f("ispreset",!1)),l.find(".rateit-hover").hide(),l.find(".rateit-selected").width(t*f("starwidth")-f("min")*f("starwidth")).show(),c.trigger("hover",[null]).trigger("over",[null]).trigger("rated",[t])};f("readonly")?a.hide():(f("resetable")||a.hide(),f("wired")||(l.bind("touchmove touchend",t),l.mousemove(function(n){var t=d(this,n);g(t)}),l.mouseleave(function(){l.find(".rateit-hover").hide().width(0).data("width",""),c.trigger("hover",[null]).trigger("over",[null]),l.find(".rateit-selected").show()}),l.mouseup(function(n){var t=d(this,n),i=t*f("step")+f("min");w(i)}),l.keyup(function(n){(n.which==38||n.which==(v?39:37))&&w(Math.min(f("value")+f("step"),f("max"))),(n.which==40||n.which==(v?37:39))&&w(Math.max(f("value")-f("step"),f("min")))}),f("wired",!0)),f("resetable")&&a.show()),l.attr("aria-readonly",f("readonly"))})},n.fn.rateit.defaults={min:0,max:5,step:.5,starwidth:16,starheight:16,readonly:!1,resetable:!0,ispreset:!1},n(function(){n("div.rateit, span.rateit").rateit()})})(jQuery);
2
- //@ sourceMappingURL=jquery.rateit.min.js.map
1
+ /*! RateIt | v1.0.22 / 05/27/2014 | https://rateit.codeplex.com/license
2
+ http://rateit.codeplex.com | Twitter: @gjunge
3
+ */
4
+ (function(n){function t(n){var u=n.originalEvent.changedTouches,t=u[0],i="",r;switch(n.type){case"touchmove":i="mousemove";break;case"touchend":i="mouseup";break;default:return}r=document.createEvent("MouseEvent");r.initMouseEvent(i,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null);t.target.dispatchEvent(r);n.preventDefault()}n.rateit={aria:{resetLabel:"reset rating",ratingLabel:"rating"}};n.fn.rateit=function(i,r){var e=1,u={},o="init",s=function(n){return n.charAt(0).toUpperCase()+n.substr(1)},f;if(this.length===0)return this;if(f=n.type(i),f=="object"||i===undefined||i===null)u=n.extend({},n.fn.rateit.defaults,i);else{if(f=="string"&&i!=="reset"&&r===undefined)return this.data("rateit"+s(i));f=="string"&&(o="setvalue")}return this.each(function(){var c=n(this),f=function(n,t){if(t!=null){var i="aria-value"+(n=="value"?"now":n),r=c.find(".rateit-range");r.attr(i)!=undefined&&r.attr(i,t)}return arguments[0]="rateit"+s(n),c.data.apply(c,arguments)},p,w,v,h,b,g,nt,l,y,k,a;if(i=="reset"){p=f("init");for(w in p)c.data(w,p[w]);f("backingfld")&&(h=n(f("backingfld")),h.val(f("value")),h.trigger("change"),h[0].min&&(h[0].min=f("min")),h[0].max&&(h[0].max=f("max")),h[0].step&&(h[0].step=f("step")));c.trigger("reset")}if(c.hasClass("rateit")||c.addClass("rateit"),v=c.css("direction")!="rtl",o=="setvalue"){if(!f("init"))throw"Can't set value before init";i!="readonly"||r!=!0||f("readonly")||(c.find(".rateit-range").unbind(),f("wired",!1));i=="value"&&(r=r==null?f("min"):Math.max(f("min"),Math.min(f("max"),r)));f("backingfld")&&(h=n(f("backingfld")),i=="value"&&h.val(r),i=="min"&&h[0].min&&(h[0].min=r),i=="max"&&h[0].max&&(h[0].max=r),i=="step"&&h[0].step&&(h[0].step=r));f(i,r)}f("init")||(f("min",isNaN(f("min"))?u.min:f("min")),f("max",isNaN(f("max"))?u.max:f("max")),f("step",f("step")||u.step),f("readonly",f("readonly")!==undefined?f("readonly"):u.readonly),f("resetable",f("resetable")!==undefined?f("resetable"):u.resetable),f("backingfld",f("backingfld")||u.backingfld),f("starwidth",f("starwidth")||u.starwidth),f("starheight",f("starheight")||u.starheight),f("value",Math.max(f("min"),Math.min(f("max"),isNaN(f("value"))?isNaN(u.value)?u.min:u.value:f("value")))),f("ispreset",f("ispreset")!==undefined?f("ispreset"):u.ispreset),f("backingfld")&&(h=n(f("backingfld")).hide(),(h.attr("disabled")||h.attr("readonly"))&&f("readonly",!0),h[0].nodeName=="INPUT"&&(h[0].type=="range"||h[0].type=="text")&&(f("min",parseInt(h.attr("min"))||f("min")),f("max",parseInt(h.attr("max"))||f("max")),f("step",parseInt(h.attr("step"))||f("step"))),h[0].nodeName=="SELECT"&&h[0].options.length>1?(f("min",isNaN(f("min"))?Number(h[0].options[0].value):f("min")),f("max",Number(h[0].options[h[0].length-1].value)),f("step",Number(h[0].options[1].value)-Number(h[0].options[0].value)),b=h.find("option[selected]"),b.length==1&&f("value",b.val())):f("value",h.val())),g=c[0].nodeName=="DIV"?"div":"span",e++,nt='<button id="rateit-reset-{{index}}" type="button" data-role="none" class="rateit-reset" aria-label="'+n.rateit.aria.resetLabel+'" aria-controls="rateit-range-{{index}}"><\/button><{{element}} id="rateit-range-{{index}}" class="rateit-range" tabindex="0" role="slider" aria-label="'+n.rateit.aria.ratingLabel+'" aria-owns="rateit-reset-{{index}}" aria-valuemin="'+f("min")+'" aria-valuemax="'+f("max")+'" aria-valuenow="'+f("value")+'"><{{element}} class="rateit-selected" style="height:'+f("starheight")+'px"><\/{{element}}><{{element}} class="rateit-hover" style="height:'+f("starheight")+'px"><\/{{element}}><\/{{element}}>',c.append(nt.replace(/{{index}}/gi,e).replace(/{{element}}/gi,g)),v||(c.find(".rateit-reset").css("float","right"),c.find(".rateit-selected").addClass("rateit-selected-rtl"),c.find(".rateit-hover").addClass("rateit-hover-rtl")),f("init",JSON.parse(JSON.stringify(c.data()))));c.find(".rateit-selected, .rateit-hover").height(f("starheight"));l=c.find(".rateit-range");l.width(f("starwidth")*(f("max")-f("min"))).height(f("starheight"));y="rateit-preset"+(v?"":"-rtl");f("ispreset")?c.find(".rateit-selected").addClass(y):c.find(".rateit-selected").removeClass(y);f("value")!=null&&(k=(f("value")-f("min"))*f("starwidth"),c.find(".rateit-selected").width(k));a=c.find(".rateit-reset");a.data("wired")!==!0&&a.bind("click",function(t){t.preventDefault();a.blur();var i=n.Event("beforereset");if(c.trigger(i),i.isDefaultPrevented())return!1;c.rateit("value",null);c.trigger("reset")}).data("wired",!0);var tt=function(t,i){var u=i.changedTouches?i.changedTouches[0].pageX:i.pageX,r=u-n(t).offset().left;return v||(r=l.width()-r),r>l.width()&&(r=l.width()),r<0&&(r=0),k=Math.ceil(r/f("starwidth")*(1/f("step")))},it=function(n){var t=n*f("starwidth")*f("step"),r=l.find(".rateit-hover"),i;r.data("width")!=t&&(l.find(".rateit-selected").hide(),r.width(t).show().data("width",t),i=[n*f("step")+f("min")],c.trigger("hover",i).trigger("over",i))},d=function(t){var i=n.Event("beforerated");return(c.trigger(i,[t]),i.isDefaultPrevented())?!1:(f("value",t),f("backingfld")&&n(f("backingfld")).val(t).trigger("change"),f("ispreset")&&(l.find(".rateit-selected").removeClass(y),f("ispreset",!1)),l.find(".rateit-hover").hide(),l.find(".rateit-selected").width(t*f("starwidth")-f("min")*f("starwidth")).show(),c.trigger("hover",[null]).trigger("over",[null]).trigger("rated",[t]),!0)};f("readonly")?a.hide():(f("resetable")||a.hide(),f("wired")||(l.bind("touchmove touchend",t),l.mousemove(function(n){var t=tt(this,n);it(t)}),l.mouseleave(function(){l.find(".rateit-hover").hide().width(0).data("width","");c.trigger("hover",[null]).trigger("over",[null]);l.find(".rateit-selected").show()}),l.mouseup(function(n){var t=tt(this,n),i=t*f("step")+f("min");d(i);l.blur()}),l.keyup(function(n){(n.which==38||n.which==(v?39:37))&&d(Math.min(f("value")+f("step"),f("max")));(n.which==40||n.which==(v?37:39))&&d(Math.max(f("value")-f("step"),f("min")))}),f("wired",!0)),f("resetable")&&a.show());l.attr("aria-readonly",f("readonly"))})};n.fn.rateit.defaults={min:0,max:5,step:.5,starwidth:16,starheight:16,readonly:!1,resetable:!0,ispreset:!1};n(function(){n("div.rateit, span.rateit").rateit()})})(jQuery);
5
+ /*
6
+ //# sourceMappingURL=jquery.rateit.min.js.map
7
+ */
@@ -1,35 +1,41 @@
1
1
  $(document).ready(function() {
2
- // $.getJSON('products/124.json', function(data) {
3
- // $("div[data-productid=423]").attr('data-rateit-value', data.average_rating / 2);
4
- // $("div[data-productid=423]").attr('data-rateit-ispreset', true);
5
- // /*var items = [];
6
- // $.each(data, function(key, val) {
7
- // items.push('<li id=""' + key + '">' + val + '</li>');
8
- // });*/
9
- // });
2
+ console.log('r: ' + window.rating);
3
+ $('.rateit').bind('reset', function(e) {
4
+ var ri = $(this);
10
5
 
11
- $('.rateit').bind('rated reset', function (e) {
12
- console.log("hello");
13
- var ri = $(this);
6
+ $.ajax({
7
+ url: '/ratings/' + window.rating + '.json',
8
+ type: 'DELETE',
9
+ success: function(data) {
10
+ window.rating = null;
11
+ ri.rateit('resetable', false);
12
+ }
13
+ });
14
+ });
14
15
 
15
- //if the use pressed reset, it will get value: 0 (to be compatible with the HTML range control), we could check if e.type == 'reset', and then set the value to null .
16
- var value = ri.rateit('value');
17
- var rateableID = ri.data('rateableid'); // if the product id was in some hidden field: ri.closest('li').find('input[name="productid"]').val()
18
- var stype = 'Gallery';
16
+ $('.rateit').bind('rated', function(e) {
17
+ var ri = $(this);
19
18
 
20
- //maybe we want to disable voting?
21
- //ri.rateit('readonly', true);
22
-
23
- $.ajax({
24
- url: '/starrable/ratings.json', //your server side script
25
- data: { id: rateableID, value: value, stype: stype }, //our data
26
- type: 'POST',
27
- success: function (data) {
28
- //$('#response').append('<li>' + data + '</li>');
29
- },
30
- error: function (jxhr, msg, err) {
31
- //$('#response').append('<li style="color:red">' + msg + '</li>');
32
- }
33
- });
34
- });
19
+ var value = ri.rateit('value');
20
+ var rateableID = ri.data('rateableid');
21
+ var stype = window.starrable_type;
22
+ if (window.rating != null) {
23
+ $.ajax({
24
+ url: '/ratings/' + window.rating + '.json',
25
+ data: { value: value },
26
+ type: 'PUT'
27
+ });
28
+ } else {
29
+ $.ajax({
30
+ url: '/ratings.json',
31
+ data: { id: rateableID, value: value, stype: stype, rid: window.rater,
32
+ rtype: window.rater_type },
33
+ type: 'POST',
34
+ success: function(data) {
35
+ window.rating = data['id'];
36
+ ri.rateit('resetable', true);
37
+ }
38
+ });
39
+ }
40
+ });
35
41
  });
@@ -5,11 +5,28 @@ class RatingsController < ApplicationController
5
5
  def create
6
6
  @rating = ::ActsAsStarrable::Rating.new(:starrable_type => params[:stype],
7
7
  :starrable_id => params[:id],
8
- :rating => params[:value])
8
+ :rating => params[:value],
9
+ :rater_type => params[:rtype],
10
+ :rater_id => params[:rid])
9
11
  if @rating.save
10
12
  render :json => @rating, :status => :created
11
13
  else
12
14
  render :json => @rating.errors, :status => :unprocessable_entity
13
15
  end
14
16
  end
17
+
18
+ def update
19
+ rating = ::ActsAsStarrable::Rating.find(params[:id])
20
+ if rating.update_attributes(:rating => params[:value])
21
+ render :nothing => true, :status => 204
22
+ else
23
+ render :nothing => true, :status => :unprocessable_entity
24
+ end
25
+ end
26
+
27
+ def destroy
28
+ rating = ::ActsAsStarrable::Rating.find(params[:id])
29
+ rating.destroy
30
+ render :nothing => true, :status => 204
31
+ end
15
32
  end
@@ -1,6 +1,24 @@
1
- <div class="rateit" data-rateableid="<%= @gallery.id %>" data-rateit-value="<%= @gallery.average_rating %>" data-rateit-ispreset="true"></div>
2
- <span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
3
- <span itemprop="ratingValue"><%= starrable.average_rating %></span> stars out of
4
- <span itemprop="bestRating"><%= starrable.max_rating %></span>
5
- (<span itemprop="ratingCount"><%= pluralize(starrable.ratings.count, 'rating') %></span> total).
6
- </span>
1
+ <% if user_signed_in? %>
2
+ <% rating = ActsAsStarrable::Rating.find(:first, :conditions => {:rater_type => 'User', :rater_id => current_user.id, :starrable_type => starrable.class, :starrable_id => starrable.id}) %>
3
+ <%= javascript_tag do %>
4
+ window.rater = '<%= current_user.id %>';
5
+ window.rater_type = '<%= current_user.class %>';
6
+ window.rating = <%= rating ? rating.id : 'null' %>;
7
+ window.starrable_type = '<%= starrable.class %>';
8
+ <% end %>
9
+ <% end %>
10
+ <% if rating %>
11
+ <div class="rateit" data-rateableid="<%= starrable.id %>" data-rateit-value="<%= rating.rating %>" data-rateit-ispreset="false"></div>
12
+ <span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">avg.
13
+ <span itemprop="ratingValue"><%= starrable.average_rating %></span> stars out of
14
+ <span itemprop="bestRating"><%= starrable.max_rating %></span>
15
+ (<span itemprop="ratingCount"><%= pluralize(starrable.ratings.count, 'rating') %></span> total).
16
+ </span>
17
+ <% else %>
18
+ <div class="rateit" data-rateableid="<%= starrable.id %>" data-rateit-value="<%= starrable.average_rating %>" data-rateit-ispreset="true" data-rateit-resetable="false" data-rateit-readonly="<%= !user_signed_in? %>"></div>
19
+ <span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
20
+ <span itemprop="ratingValue"><%= starrable.average_rating %></span> stars out of
21
+ <span itemprop="bestRating"><%= starrable.max_rating %></span>
22
+ (<span itemprop="ratingCount"><%= pluralize(starrable.ratings.count, 'rating') %></span> total).
23
+ </span>
24
+ <% end %>
@@ -1,4 +1,4 @@
1
1
  # Encoding: utf-8
2
2
  Rails.application.routes.draw do
3
- resources :ratings, :only => [:create]
3
+ resources :ratings, :only => [:create, :update, :destroy]
4
4
  end
@@ -1,4 +1,4 @@
1
1
  # Encoding: utf-8
2
2
  module ActsAsStarrable
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
@@ -32,4 +32,53 @@ describe RatingsController do
32
32
  it { should respond_with 422 }
33
33
  end
34
34
  end
35
+
36
+ describe '#update' do
37
+
38
+ context 'success' do
39
+
40
+ before do
41
+ expect(ActsAsStarrable::Rating).to receive(:find)
42
+ .with("#{instance.id}").and_return(instance)
43
+ expect(instance).to receive(:update_attributes)
44
+ .and_return(true)
45
+ put :update, :format => :json, :id => instance, :rating =>
46
+ { :id => '1',
47
+ :stype => 'Flick',
48
+ :value => '3.5'
49
+ }
50
+ end
51
+
52
+ it { should respond_with 204 }
53
+ end
54
+
55
+ context 'failure' do
56
+
57
+ before do
58
+ expect(ActsAsStarrable::Rating).to receive(:find)
59
+ .with("#{instance.id}").and_return(instance)
60
+ expect(instance).to receive(:update_attributes)
61
+ .and_return(false)
62
+ put :update, :format => :json, :id => instance, :rating =>
63
+ { :id => '1',
64
+ :stype => 'Flick',
65
+ :value => '3.5'
66
+ }
67
+ end
68
+
69
+ it { should respond_with 422 }
70
+ end
71
+ end
72
+
73
+ describe '#destroy' do
74
+
75
+ before do
76
+ expect(ActsAsStarrable::Rating).to receive(:find)
77
+ .with("#{instance.id}").and_return(instance)
78
+ expect(instance).to receive(:destroy).and_return(instance)
79
+ delete :destroy, :format => 'json', :id => instance
80
+ end
81
+
82
+ it { should respond_with 204 }
83
+ end
35
84
  end
@@ -156,3 +156,4 @@ Connecting to database specified by database.yml
156
156
   (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140412132501')
157
157
   (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140409035450')
158
158
   (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140409041520')
159
+ Connecting to database specified by database.yml
@@ -625,3 +625,547 @@ Completed 201 Created in 1.4ms (Views: 1.0ms | ActiveRecord: 0.2ms)
625
625
   (0.0ms) rollback transaction
626
626
   (0.0ms) begin transaction
627
627
   (0.0ms) rollback transaction
628
+ Connecting to database specified by database.yml
629
+  (0.4ms) begin transaction
630
+ Processing by RatingsController#create as JSON
631
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
632
+ Completed 201 Created in 3.9ms (Views: 1.4ms | ActiveRecord: 2.1ms)
633
+  (0.0ms) rollback transaction
634
+  (0.0ms) begin transaction
635
+ Processing by RatingsController#create as JSON
636
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
637
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
638
+  (0.0ms) rollback transaction
639
+  (0.0ms) begin transaction
640
+  (0.0ms) rollback transaction
641
+  (0.0ms) begin transaction
642
+  (0.0ms) rollback transaction
643
+ Connecting to database specified by database.yml
644
+  (0.4ms) begin transaction
645
+  (0.1ms) rollback transaction
646
+  (0.0ms) begin transaction
647
+ Processing by RatingsController#create as JSON
648
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
649
+ Completed 201 Created in 34.7ms (Views: 1.1ms | ActiveRecord: 33.2ms)
650
+  (0.1ms) rollback transaction
651
+  (0.0ms) begin transaction
652
+ Processing by RatingsController#create as JSON
653
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
654
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
655
+  (0.0ms) rollback transaction
656
+  (0.0ms) begin transaction
657
+  (0.0ms) rollback transaction
658
+  (0.0ms) begin transaction
659
+  (0.0ms) rollback transaction
660
+ Connecting to database specified by database.yml
661
+  (0.4ms) begin transaction
662
+  (0.0ms) rollback transaction
663
+  (0.0ms) begin transaction
664
+ Processing by RatingsController#create as JSON
665
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
666
+ Completed 422 Unprocessable Entity in 0.5ms (Views: 0.1ms | ActiveRecord: 0.0ms)
667
+  (0.1ms) rollback transaction
668
+  (0.0ms) begin transaction
669
+ Processing by RatingsController#create as JSON
670
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
671
+ Completed 201 Created in 8.2ms (Views: 1.4ms | ActiveRecord: 6.7ms)
672
+  (0.0ms) rollback transaction
673
+  (0.0ms) begin transaction
674
+  (0.1ms) rollback transaction
675
+  (0.0ms) begin transaction
676
+  (0.0ms) rollback transaction
677
+ Connecting to database specified by database.yml
678
+  (0.4ms) begin transaction
679
+ Processing by RatingsController#create as JSON
680
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
681
+ Completed 201 Created in 6.8ms (Views: 1.4ms | ActiveRecord: 5.1ms)
682
+  (0.0ms) rollback transaction
683
+  (0.0ms) begin transaction
684
+ Processing by RatingsController#create as JSON
685
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
686
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
687
+  (0.0ms) rollback transaction
688
+  (0.0ms) begin transaction
689
+ Processing by RatingsController#destroy as JSON
690
+ Parameters: {"id"=>"1003"}
691
+ Completed 500 Internal Server Error in 41.0ms
692
+  (0.1ms) rollback transaction
693
+  (0.0ms) begin transaction
694
+  (0.1ms) rollback transaction
695
+  (0.0ms) begin transaction
696
+  (0.0ms) rollback transaction
697
+ Connecting to database specified by database.yml
698
+  (0.4ms) begin transaction
699
+ Processing by RatingsController#create as JSON
700
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
701
+ Completed 201 Created in 3.7ms (Views: 1.4ms | ActiveRecord: 2.0ms)
702
+  (0.0ms) rollback transaction
703
+  (0.0ms) begin transaction
704
+ Processing by RatingsController#create as JSON
705
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
706
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
707
+  (0.0ms) rollback transaction
708
+  (0.0ms) begin transaction
709
+ Processing by RatingsController#destroy as JSON
710
+ Parameters: {"id"=>"1003"}
711
+ Completed 500 Internal Server Error in 40.1ms
712
+  (0.1ms) rollback transaction
713
+  (0.0ms) begin transaction
714
+  (0.1ms) rollback transaction
715
+  (0.0ms) begin transaction
716
+  (0.0ms) rollback transaction
717
+ Connecting to database specified by database.yml
718
+  (581.7ms) begin transaction
719
+ Processing by RatingsController#destroy as JSON
720
+ Parameters: {"id"=>"1001"}
721
+ Completed 500 Internal Server Error in 16.5ms
722
+  (0.3ms) rollback transaction
723
+  (0.0ms) begin transaction
724
+ Processing by RatingsController#create as JSON
725
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
726
+ Completed 422 Unprocessable Entity in 0.5ms (Views: 0.1ms | ActiveRecord: 0.0ms)
727
+  (0.1ms) rollback transaction
728
+  (0.0ms) begin transaction
729
+ Processing by RatingsController#create as JSON
730
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
731
+ Completed 201 Created in 28.8ms (Views: 1.4ms | ActiveRecord: 27.3ms)
732
+  (0.0ms) rollback transaction
733
+  (0.0ms) begin transaction
734
+  (0.1ms) rollback transaction
735
+  (0.0ms) begin transaction
736
+  (0.0ms) rollback transaction
737
+ Connecting to database specified by database.yml
738
+  (24.6ms) begin transaction
739
+ Processing by RatingsController#create as JSON
740
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
741
+ Completed 201 Created in 48.5ms (Views: 1.4ms | ActiveRecord: 46.7ms)
742
+  (0.1ms) rollback transaction
743
+  (0.0ms) begin transaction
744
+ Processing by RatingsController#create as JSON
745
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
746
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
747
+  (0.0ms) rollback transaction
748
+  (0.0ms) begin transaction
749
+ Processing by RatingsController#destroy as JSON
750
+ Parameters: {"id"=>"1003"}
751
+ Completed 200 OK in 68.9ms (Views: 68.6ms | ActiveRecord: 0.0ms)
752
+  (0.1ms) rollback transaction
753
+  (0.0ms) begin transaction
754
+  (0.1ms) rollback transaction
755
+  (0.0ms) begin transaction
756
+  (0.0ms) rollback transaction
757
+ Connecting to database specified by database.yml
758
+  (0.4ms) begin transaction
759
+ Processing by RatingsController#create as JSON
760
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
761
+ Completed 201 Created in 4.0ms (Views: 1.5ms | ActiveRecord: 2.1ms)
762
+  (0.0ms) rollback transaction
763
+  (0.0ms) begin transaction
764
+ Processing by RatingsController#create as JSON
765
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
766
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
767
+  (0.0ms) rollback transaction
768
+  (0.0ms) begin transaction
769
+ Processing by RatingsController#destroy as JSON
770
+ Parameters: {"id"=>"1003"}
771
+ Completed 204 No Content in 276.0ms (Views: 275.8ms | ActiveRecord: 0.0ms)
772
+  (0.1ms) rollback transaction
773
+  (0.0ms) begin transaction
774
+  (0.1ms) rollback transaction
775
+  (0.0ms) begin transaction
776
+  (0.1ms) rollback transaction
777
+ Connecting to database specified by database.yml
778
+  (0.4ms) begin transaction
779
+ Processing by RatingsController#create as JSON
780
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
781
+ Completed 201 Created in 4.0ms (Views: 1.4ms | ActiveRecord: 2.2ms)
782
+  (0.0ms) rollback transaction
783
+  (0.0ms) begin transaction
784
+ Processing by RatingsController#create as JSON
785
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
786
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
787
+  (0.0ms) rollback transaction
788
+  (0.0ms) begin transaction
789
+ Processing by RatingsController#destroy as JSON
790
+ Parameters: {"id"=>"1003"}
791
+ Completed 204 No Content in 38.1ms (Views: 37.8ms | ActiveRecord: 0.0ms)
792
+  (0.1ms) rollback transaction
793
+  (0.0ms) begin transaction
794
+  (0.1ms) rollback transaction
795
+  (0.0ms) begin transaction
796
+  (0.0ms) rollback transaction
797
+ Connecting to database specified by database.yml
798
+  (0.4ms) begin transaction
799
+ Processing by RatingsController#destroy as JSON
800
+ Parameters: {"id"=>"1001"}
801
+ Rendered text template (0.0ms)
802
+ Completed 204 No Content in 11.5ms (Views: 11.2ms | ActiveRecord: 0.0ms)
803
+  (0.1ms) rollback transaction
804
+  (0.0ms) begin transaction
805
+ Processing by RatingsController#create as JSON
806
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
807
+ Completed 422 Unprocessable Entity in 0.4ms (Views: 0.1ms | ActiveRecord: 0.0ms)
808
+  (0.0ms) rollback transaction
809
+  (0.0ms) begin transaction
810
+ Processing by RatingsController#create as JSON
811
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
812
+ Completed 201 Created in 0.6ms (Views: 0.4ms | ActiveRecord: 0.0ms)
813
+  (0.1ms) rollback transaction
814
+  (0.0ms) begin transaction
815
+  (0.1ms) rollback transaction
816
+  (0.0ms) begin transaction
817
+  (0.0ms) rollback transaction
818
+ Connecting to database specified by database.yml
819
+  (0.4ms) begin transaction
820
+ Processing by RatingsController#create as JSON
821
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
822
+ Completed 201 Created in 3.6ms (Views: 1.4ms | ActiveRecord: 1.9ms)
823
+  (0.0ms) rollback transaction
824
+  (0.0ms) begin transaction
825
+ Processing by RatingsController#create as JSON
826
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
827
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
828
+  (0.0ms) rollback transaction
829
+  (0.0ms) begin transaction
830
+ Processing by RatingsController#destroy as JSON
831
+ Parameters: {"id"=>"1003"}
832
+ Completed 204 No Content in 36.3ms (Views: 36.0ms | ActiveRecord: 0.0ms)
833
+  (0.1ms) rollback transaction
834
+  (0.0ms) begin transaction
835
+  (0.1ms) rollback transaction
836
+  (0.0ms) begin transaction
837
+  (0.0ms) rollback transaction
838
+ Connecting to database specified by database.yml
839
+  (0.4ms) begin transaction
840
+ Processing by RatingsController#destroy as JSON
841
+ Parameters: {"id"=>"1001"}
842
+ Rendered text template (0.0ms)
843
+ Completed 204 No Content in 11.2ms (Views: 10.8ms | ActiveRecord: 0.0ms)
844
+  (0.1ms) rollback transaction
845
+  (0.0ms) begin transaction
846
+ Processing by RatingsController#create as JSON
847
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
848
+ Completed 422 Unprocessable Entity in 0.4ms (Views: 0.1ms | ActiveRecord: 0.0ms)
849
+  (0.0ms) rollback transaction
850
+  (0.0ms) begin transaction
851
+ Processing by RatingsController#create as JSON
852
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
853
+ Completed 201 Created in 28.4ms (Views: 1.5ms | ActiveRecord: 26.7ms)
854
+  (0.0ms) rollback transaction
855
+  (0.0ms) begin transaction
856
+  (0.1ms) rollback transaction
857
+  (0.0ms) begin transaction
858
+  (0.0ms) rollback transaction
859
+ Connecting to database specified by database.yml
860
+  (0.4ms) begin transaction
861
+ Processing by RatingsController#create as JSON
862
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
863
+ Completed 201 Created in 3.6ms (Views: 1.4ms | ActiveRecord: 1.9ms)
864
+  (0.0ms) rollback transaction
865
+  (0.0ms) begin transaction
866
+ Processing by RatingsController#create as JSON
867
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
868
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
869
+  (0.0ms) rollback transaction
870
+  (0.0ms) begin transaction
871
+ Processing by RatingsController#destroy as JSON
872
+ Parameters: {"id"=>"1003"}
873
+ Completed 204 No Content in 35.9ms (Views: 35.6ms | ActiveRecord: 0.0ms)
874
+  (0.1ms) rollback transaction
875
+  (0.0ms) begin transaction
876
+  (0.1ms) rollback transaction
877
+  (0.0ms) begin transaction
878
+  (0.0ms) rollback transaction
879
+ Connecting to database specified by database.yml
880
+  (0.4ms) begin transaction
881
+  (0.0ms) rollback transaction
882
+  (0.0ms) begin transaction
883
+  (0.0ms) rollback transaction
884
+  (0.0ms) begin transaction
885
+ Processing by RatingsController#destroy as JSON
886
+ Parameters: {"id"=>"1001"}
887
+ Rendered text template (0.0ms)
888
+ Completed 204 No Content in 41.3ms (Views: 40.9ms | ActiveRecord: 0.0ms)
889
+  (0.1ms) rollback transaction
890
+  (0.0ms) begin transaction
891
+  (0.0ms) rollback transaction
892
+  (0.0ms) begin transaction
893
+  (0.0ms) rollback transaction
894
+  (0.0ms) begin transaction
895
+ Processing by RatingsController#create as JSON
896
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
897
+ Completed 201 Created in 1.6ms (Views: 1.0ms | ActiveRecord: 0.2ms)
898
+  (0.0ms) rollback transaction
899
+  (0.0ms) begin transaction
900
+ Processing by RatingsController#create as JSON
901
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
902
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
903
+  (0.0ms) rollback transaction
904
+ Connecting to database specified by database.yml
905
+  (0.4ms) begin transaction
906
+  (0.0ms) rollback transaction
907
+  (0.0ms) begin transaction
908
+  (0.0ms) rollback transaction
909
+  (0.0ms) begin transaction
910
+  (0.0ms) rollback transaction
911
+  (0.0ms) begin transaction
912
+ Processing by RatingsController#create as JSON
913
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
914
+ Completed 201 Created in 1.6ms (Views: 1.1ms | ActiveRecord: 0.2ms)
915
+  (0.0ms) rollback transaction
916
+  (0.0ms) begin transaction
917
+ Processing by RatingsController#create as JSON
918
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
919
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
920
+  (0.0ms) rollback transaction
921
+  (0.0ms) begin transaction
922
+ Processing by RatingsController#destroy as JSON
923
+ Parameters: {"id"=>"1005"}
924
+ Completed 204 No Content in 43.2ms (Views: 42.8ms | ActiveRecord: 0.0ms)
925
+  (0.1ms) rollback transaction
926
+  (0.0ms) begin transaction
927
+  (0.0ms) rollback transaction
928
+ Connecting to database specified by database.yml
929
+  (0.4ms) begin transaction
930
+ Processing by RatingsController#create as JSON
931
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
932
+ Completed 201 Created in 3.5ms (Views: 1.4ms | ActiveRecord: 1.9ms)
933
+  (0.0ms) rollback transaction
934
+  (0.0ms) begin transaction
935
+ Processing by RatingsController#create as JSON
936
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
937
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
938
+  (0.0ms) rollback transaction
939
+  (0.0ms) begin transaction
940
+ Processing by RatingsController#update as JSON
941
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1003"}
942
+ Completed 500 Internal Server Error in 57.8ms
943
+  (0.1ms) rollback transaction
944
+  (0.0ms) begin transaction
945
+ Processing by RatingsController#update as JSON
946
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1004"}
947
+ Completed 500 Internal Server Error in 0.5ms
948
+  (0.0ms) rollback transaction
949
+  (0.0ms) begin transaction
950
+ Processing by RatingsController#destroy as JSON
951
+ Parameters: {"id"=>"1005"}
952
+ Completed 204 No Content in 2.3ms (Views: 2.0ms | ActiveRecord: 0.0ms)
953
+  (0.0ms) rollback transaction
954
+  (0.0ms) begin transaction
955
+  (0.1ms) rollback transaction
956
+  (0.0ms) begin transaction
957
+  (0.0ms) rollback transaction
958
+ Connecting to database specified by database.yml
959
+  (0.4ms) begin transaction
960
+  (0.0ms) rollback transaction
961
+  (0.0ms) begin transaction
962
+ Processing by RatingsController#update as JSON
963
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1001"}
964
+ Rendered text template (0.0ms)
965
+ Completed 200 OK in 40.9ms (Views: 40.6ms | ActiveRecord: 0.0ms)
966
+  (0.1ms) rollback transaction
967
+  (0.0ms) begin transaction
968
+ Processing by RatingsController#update as JSON
969
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1002"}
970
+ Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)
971
+  (0.0ms) rollback transaction
972
+  (0.0ms) begin transaction
973
+ Processing by RatingsController#create as JSON
974
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
975
+ Completed 201 Created in 1.5ms (Views: 1.0ms | ActiveRecord: 0.2ms)
976
+  (0.0ms) rollback transaction
977
+  (0.0ms) begin transaction
978
+ Processing by RatingsController#create as JSON
979
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
980
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
981
+  (0.0ms) rollback transaction
982
+  (0.0ms) begin transaction
983
+ Processing by RatingsController#destroy as JSON
984
+ Parameters: {"id"=>"1005"}
985
+ Completed 204 No Content in 0.5ms (Views: 0.2ms | ActiveRecord: 0.0ms)
986
+  (0.0ms) rollback transaction
987
+  (0.0ms) begin transaction
988
+  (0.0ms) rollback transaction
989
+ Connecting to database specified by database.yml
990
+  (0.4ms) begin transaction
991
+ Processing by RatingsController#create as JSON
992
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
993
+ Completed 201 Created in 3.6ms (Views: 1.4ms | ActiveRecord: 1.9ms)
994
+  (0.0ms) rollback transaction
995
+  (0.0ms) begin transaction
996
+ Processing by RatingsController#create as JSON
997
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
998
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
999
+  (0.0ms) rollback transaction
1000
+  (0.0ms) begin transaction
1001
+ Processing by RatingsController#update as JSON
1002
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1003"}
1003
+ Completed 204 No Content in 36.1ms (Views: 35.8ms | ActiveRecord: 0.0ms)
1004
+  (0.1ms) rollback transaction
1005
+  (0.0ms) begin transaction
1006
+ Processing by RatingsController#update as JSON
1007
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1004"}
1008
+ Completed 204 No Content in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1009
+  (0.0ms) rollback transaction
1010
+  (0.0ms) begin transaction
1011
+ Processing by RatingsController#destroy as JSON
1012
+ Parameters: {"id"=>"1005"}
1013
+ Completed 204 No Content in 0.5ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1014
+  (0.0ms) rollback transaction
1015
+  (0.0ms) begin transaction
1016
+  (0.1ms) rollback transaction
1017
+  (0.0ms) begin transaction
1018
+  (0.0ms) rollback transaction
1019
+ Connecting to database specified by database.yml
1020
+  (0.4ms) begin transaction
1021
+ Processing by RatingsController#create as JSON
1022
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
1023
+ Completed 422 Unprocessable Entity in 0.5ms (Views: 0.1ms | ActiveRecord: 0.0ms)
1024
+  (0.0ms) rollback transaction
1025
+  (0.0ms) begin transaction
1026
+ Processing by RatingsController#create as JSON
1027
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
1028
+ Completed 201 Created in 3.4ms (Views: 1.3ms | ActiveRecord: 1.9ms)
1029
+  (0.0ms) rollback transaction
1030
+  (0.0ms) begin transaction
1031
+ Processing by RatingsController#update as JSON
1032
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1003"}
1033
+ Completed 204 No Content in 36.1ms (Views: 35.8ms | ActiveRecord: 0.0ms)
1034
+  (0.1ms) rollback transaction
1035
+  (0.0ms) begin transaction
1036
+ Processing by RatingsController#update as JSON
1037
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1004"}
1038
+ Completed 204 No Content in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1039
+  (0.0ms) rollback transaction
1040
+  (0.0ms) begin transaction
1041
+ Processing by RatingsController#destroy as JSON
1042
+ Parameters: {"id"=>"1005"}
1043
+ Completed 204 No Content in 0.5ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1044
+  (0.0ms) rollback transaction
1045
+  (0.0ms) begin transaction
1046
+  (0.1ms) rollback transaction
1047
+  (0.0ms) begin transaction
1048
+  (0.0ms) rollback transaction
1049
+ Connecting to database specified by database.yml
1050
+  (0.4ms) begin transaction
1051
+  (0.0ms) rollback transaction
1052
+  (0.0ms) begin transaction
1053
+  (0.0ms) rollback transaction
1054
+  (0.0ms) begin transaction
1055
+ Processing by RatingsController#destroy as JSON
1056
+ Parameters: {"id"=>"1001"}
1057
+ Rendered text template (0.0ms)
1058
+ Completed 204 No Content in 41.5ms (Views: 41.1ms | ActiveRecord: 0.0ms)
1059
+  (0.1ms) rollback transaction
1060
+  (0.0ms) begin transaction
1061
+ Processing by RatingsController#update as JSON
1062
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1002"}
1063
+ Completed 204 No Content in 0.6ms (Views: 0.3ms | ActiveRecord: 0.0ms)
1064
+  (0.0ms) rollback transaction
1065
+  (0.0ms) begin transaction
1066
+ Processing by RatingsController#update as JSON
1067
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1003"}
1068
+ Completed 422 Unprocessable Entity in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1069
+  (0.0ms) rollback transaction
1070
+  (0.0ms) begin transaction
1071
+ Processing by RatingsController#create as JSON
1072
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
1073
+ Completed 201 Created in 1.5ms (Views: 1.0ms | ActiveRecord: 0.2ms)
1074
+  (0.0ms) rollback transaction
1075
+  (0.0ms) begin transaction
1076
+ Processing by RatingsController#create as JSON
1077
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
1078
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
1079
+  (0.0ms) rollback transaction
1080
+ Connecting to database specified by database.yml
1081
+  (0.4ms) begin transaction
1082
+ Processing by RatingsController#create as JSON
1083
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
1084
+ Completed 201 Created in 3.6ms (Views: 1.4ms | ActiveRecord: 1.9ms)
1085
+  (0.0ms) rollback transaction
1086
+  (0.0ms) begin transaction
1087
+ Processing by RatingsController#create as JSON
1088
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
1089
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
1090
+  (0.0ms) rollback transaction
1091
+  (0.0ms) begin transaction
1092
+ Processing by RatingsController#update as JSON
1093
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1003"}
1094
+ Completed 204 No Content in 36.3ms (Views: 35.9ms | ActiveRecord: 0.0ms)
1095
+  (0.1ms) rollback transaction
1096
+  (0.0ms) begin transaction
1097
+ Processing by RatingsController#update as JSON
1098
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1004"}
1099
+ Completed 422 Unprocessable Entity in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1100
+  (0.0ms) rollback transaction
1101
+  (0.0ms) begin transaction
1102
+ Processing by RatingsController#destroy as JSON
1103
+ Parameters: {"id"=>"1005"}
1104
+ Completed 204 No Content in 0.5ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1105
+  (0.0ms) rollback transaction
1106
+  (0.0ms) begin transaction
1107
+  (0.1ms) rollback transaction
1108
+  (0.0ms) begin transaction
1109
+  (0.0ms) rollback transaction
1110
+ Connecting to database specified by database.yml
1111
+  (0.4ms) begin transaction
1112
+ Processing by RatingsController#create as JSON
1113
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
1114
+ Completed 201 Created in 3.9ms (Views: 1.4ms | ActiveRecord: 2.1ms)
1115
+  (0.0ms) rollback transaction
1116
+  (0.0ms) begin transaction
1117
+ Processing by RatingsController#create as JSON
1118
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
1119
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
1120
+  (0.0ms) rollback transaction
1121
+  (0.0ms) begin transaction
1122
+ Processing by RatingsController#update as JSON
1123
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1003"}
1124
+ Completed 204 No Content in 38.7ms (Views: 38.3ms | ActiveRecord: 0.0ms)
1125
+  (0.1ms) rollback transaction
1126
+  (0.0ms) begin transaction
1127
+ Processing by RatingsController#update as JSON
1128
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1004"}
1129
+ Completed 422 Unprocessable Entity in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1130
+  (0.0ms) rollback transaction
1131
+  (0.0ms) begin transaction
1132
+ Processing by RatingsController#destroy as JSON
1133
+ Parameters: {"id"=>"1005"}
1134
+ Completed 204 No Content in 0.5ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1135
+  (0.0ms) rollback transaction
1136
+  (0.0ms) begin transaction
1137
+  (0.1ms) rollback transaction
1138
+  (0.0ms) begin transaction
1139
+  (0.0ms) rollback transaction
1140
+ Connecting to database specified by database.yml
1141
+ Connecting to database specified by database.yml
1142
+  (0.4ms) begin transaction
1143
+  (0.0ms) rollback transaction
1144
+  (0.0ms) begin transaction
1145
+ Processing by RatingsController#destroy as JSON
1146
+ Parameters: {"id"=>"1001"}
1147
+ Rendered text template (0.0ms)
1148
+ Completed 204 No Content in 42.4ms (Views: 42.0ms | ActiveRecord: 0.0ms)
1149
+  (0.1ms) rollback transaction
1150
+  (0.0ms) begin transaction
1151
+ Processing by RatingsController#create as JSON
1152
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
1153
+ Completed 201 Created in 1.5ms (Views: 1.0ms | ActiveRecord: 0.2ms)
1154
+  (0.0ms) rollback transaction
1155
+  (0.0ms) begin transaction
1156
+ Processing by RatingsController#create as JSON
1157
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"2.5"}}
1158
+ Completed 422 Unprocessable Entity in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
1159
+  (0.0ms) rollback transaction
1160
+  (0.0ms) begin transaction
1161
+ Processing by RatingsController#update as JSON
1162
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1004"}
1163
+ Completed 204 No Content in 0.5ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1164
+  (0.0ms) rollback transaction
1165
+  (0.0ms) begin transaction
1166
+ Processing by RatingsController#update as JSON
1167
+ Parameters: {"rating"=>{"id"=>"1", "stype"=>"Flick", "value"=>"3.5"}, "id"=>"1005"}
1168
+ Completed 422 Unprocessable Entity in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1169
+  (0.0ms) rollback transaction
1170
+  (0.0ms) begin transaction
1171
+  (0.0ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_starrable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-10 00:00:00.000000000 Z
12
+ date: 2014-06-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -146,6 +146,8 @@ executables: []
146
146
  extensions: []
147
147
  extra_rdoc_files: []
148
148
  files:
149
+ - app/assets/images/delete.gif
150
+ - app/assets/images/star.gif
149
151
  - app/assets/javascripts/application.js
150
152
  - app/assets/javascripts/jquery.rateit.min.js
151
153
  - app/assets/javascripts/starrable.js
@@ -168,7 +170,7 @@ files:
168
170
  - lib/tasks/acts_as_starrable_tasks.rake
169
171
  - MIT-LICENSE
170
172
  - Rakefile
171
- - README.rdoc
173
+ - README.md
172
174
  - spec/controllers/ratings_controller_spec.rb
173
175
  - spec/dummy/app/assets/images/rails.png
174
176
  - spec/dummy/app/assets/javascripts/application.js
@@ -1,3 +0,0 @@
1
- = ActsAsStarrable
2
-
3
- Acts as Starrable allows you to easily add star ratings to Rails models.