Hacked some column sorting onto RatesController
* Added SortHelper to RatesController * Init and updating the sorting (pre 0.8 sort_update) * RatesController#index will only render the layout on non-xhr requests * Changed Rate.history_for_user to take an order clause * Added rate_sort_header_tag and rate_sort_link to the SortHelper in order to get the correct parameters for sorting Rates * Added rate_sort_header_tags to the Rate lists #1915
This commit is contained in:
+3
-3
@@ -11,13 +11,13 @@ class Rate < ActiveRecord::Base
|
||||
before_save :unlocked?
|
||||
before_destroy :unlocked?
|
||||
|
||||
named_scope :history_for_user, lambda { |user|
|
||||
named_scope :history_for_user, lambda { |user, order|
|
||||
{
|
||||
:conditions => { :user_id => user.id },
|
||||
:order => 'date_in_effect DESC'
|
||||
:order => order
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def locked?
|
||||
return self.time_entries.length > 0
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user