Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
James Strong committed Mar 4, 2011
1 parent 51bb00a commit dc0bd0e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/models/member.rb
@@ -1,6 +1,7 @@
include ApplicationHelper
class Member
include Mongoid::Document
include Mongoid::Timestamps
referenced_in :user
referenced_in :project
after_destroy :destroy_project_rate
Expand Down
1 change: 1 addition & 0 deletions app/models/project_rate.rb
@@ -1,3 +1,4 @@
class ProjectRate < Rate
referenced_in :project
referenced_in :user
end
3 changes: 1 addition & 2 deletions app/models/rate.rb
@@ -1,5 +1,4 @@
class Rate
include Mongoid::Document
field :amount
referenced_in :user
field :amount, :type => Integer
end
2 changes: 1 addition & 1 deletion app/models/user.rb
Expand Up @@ -20,7 +20,7 @@ def projects
end
def rate_for(object)
if object.instance_of? Project
rates.where(:project_id => object.id).first
rates.where(:project_id => object.id).desc(:_id).first
end
end
def tasks_for_dates(start_date, end_date)
Expand Down

0 comments on commit dc0bd0e

Please sign in to comment.