Permalink
Browse files

Removed ratings - will replace with reputations

  • Loading branch information...
cpursley committed Dec 6, 2012
1 parent 22a264a commit 1c7ac9678c797593391a92de12f7d97a941dbebf
Showing with 0 additions and 18 deletions.
  1. +0 −7 app/controllers/dreams_controller.rb
  2. +0 −10 app/models/dream.rb
  3. +0 −1 app/models/user.rb
@@ -45,13 +45,6 @@ def show
@dream = Dream.find(params[:id])
@comments = @dream.comments.all
- if user_signed_in?
- @rating_currentuser = @dream.ratings.find_by_user_id(current_user.id)
- unless @rating_currentuser
- @rating_currentuser = current_user.ratings.new
- end
- end
-
respond_to do |format|
format.html # show.html.erb
format.json { render json: @dream }
View
@@ -1,7 +1,6 @@
class Dream < ActiveRecord::Base
belongs_to :user
has_many :comments, :dependent => :destroy
- has_many :ratings, :dependent => :destroy
attr_accessible :title, :teaser, :body, :version, :changelog, :user_id, :message, :freezebody, :state, :submitted, :accepted, :tag_list
@@ -17,15 +16,6 @@ class Dream < ActiveRecord::Base
validates :state, :presence => true, :numericality => true, :inclusion => { :in => 0..4 }
-def count_ratings
- self.ratings.all.count
-end
-
-def avg_rating
- @avg = self.ratings.average(:stars)
- @avg ? @avg : 0
-end
-
def self.search(search)
if search
where('title LIKE ? or teaser LIKE ?', "%#{search}%", "%#{search}%")
View
@@ -7,7 +7,6 @@ class User < ActiveRecord::Base
has_many :dreams, :dependent => :destroy
has_many :comments, :dependent => :destroy
- has_many :ratings, :dependent => :destroy
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me, :fullname, :shortbio, :weburl

0 comments on commit 1c7ac96

Please sign in to comment.