Feature #44463 ยป 0001-Add-the-Updated-column-to-the-spent-time-list-to-all.patch
| app/models/time_entry_query.rb | ||
|---|---|---|
| 25 | 25 |
QueryColumn.new(:project, :sortable => "#{Project.table_name}.name", :groupable => true),
|
| 26 | 26 |
QueryColumn.new(:spent_on, :sortable => ["#{TimeEntry.table_name}.spent_on", "#{TimeEntry.table_name}.created_on"], :default_order => 'desc', :groupable => true),
|
| 27 | 27 |
TimestampQueryColumn.new(:created_on, :sortable => "#{TimeEntry.table_name}.created_on", :default_order => 'desc', :groupable => true),
|
| 28 |
TimestampQueryColumn.new(:updated_on, :sortable => "#{TimeEntry.table_name}.updated_on", :default_order => 'desc', :groupable => true),
|
|
| 28 | 29 |
QueryColumn.new(:tweek, :sortable => ["#{TimeEntry.table_name}.tyear", "#{TimeEntry.table_name}.tweek"], :caption => :label_week),
|
| 29 | 30 |
QueryColumn.new(:author, :sortable => lambda {User.fields_for_order_statement}),
|
| 30 | 31 |
QueryColumn.new(:user, :sortable => lambda {User.fields_for_order_statement}, :groupable => true),
|
| test/functional/timelog_controller_test.rb | ||
|---|---|---|
| 1192 | 1192 |
) |
| 1193 | 1193 |
end |
| 1194 |
def test_index_should_sort_by_updated_on |
|
| 1195 |
TimeEntry.where(:id => 2).update_all(:updated_on => '2012-06-16 20:00:00') |
|
| 1196 | ||
| 1197 |
get( |
|
| 1198 |
:index, |
|
| 1199 |
:params => {
|
|
| 1200 |
:project_id => 1, |
|
| 1201 |
:sort => 'updated_on:desc' |
|
| 1202 |
} |
|
| 1203 |
) |
|
| 1204 |
assert_response :success |
|
| 1205 |
assert_equal( |
|
| 1206 |
%w(2 4 3 1), |
|
| 1207 |
css_select('input[name="ids[]"]').map {|e| e.attr(:value)}
|
|
| 1208 |
) |
|
| 1209 |
end |
|
| 1210 | ||
| 1194 | 1211 |
def test_index_should_sort_by_tweek_and_spent_on |
| 1195 | 1212 |
t1 = TimeEntry.generate!(:spent_on => '2012-06-10') # tyear:2012, tweek:23 |
| 1196 | 1213 |
t2 = TimeEntry.generate!(:spent_on => '2012-06-11') # tyear:2012, tweek:24 |