Fixed project last_activity. Links color changed a bit

This commit is contained in:
Dmitriy Zaporozhets 2012-08-30 09:09:42 +03:00
parent 793db070f0
commit 4e47402852
4 changed files with 20 additions and 20 deletions

View file

@ -8,7 +8,7 @@ class Project < ActiveRecord::Base
#
# Relations
#
#
belongs_to :owner, class_name: "User"
has_many :users, through: :users_projects
has_many :events, dependent: :destroy
@ -25,12 +25,12 @@ class Project < ActiveRecord::Base
attr_accessor :error_code
#
#
# Protected attributes
#
attr_protected :private_flag, :owner_id
#
#
# Scopes
#
scope :public_only, where(private_flag: false)
@ -158,7 +158,7 @@ class Project < ActiveRecord::Base
end
def last_activity
events.last || nil
events.order("created_at DESC").first || nil
end
def last_activity_date