@@ -274,7 +274,7 class Project < ActiveRecord::Base | |||
|
274 | 274 | |
|
275 | 275 | def to_param |
|
276 | 276 | # id is used for projects with a numeric identifier (compatibility) |
|
277 | @to_param ||= (identifier.to_s =~ %r{^\d*$} ? id : identifier) | |
|
277 | @to_param ||= (identifier.to_s =~ %r{^\d*$} ? id.to_s : identifier) | |
|
278 | 278 | end |
|
279 | 279 | |
|
280 | 280 | def active? |
@@ -920,6 +920,14 RAW | |||
|
920 | 920 | link_to_project(project, {:action => 'settings'}, :class => "project") |
|
921 | 921 | end |
|
922 | 922 | |
|
923 | def test_link_to_legacy_project_with_numerical_identifier_should_use_id | |
|
924 | # numeric identifier are no longer allowed | |
|
925 | Project.update_all "identifier=25", "id=1" | |
|
926 | ||
|
927 | assert_equal '<a href="/projects/1">eCookbook</a>', | |
|
928 | link_to_project(Project.find(1)) | |
|
929 | end | |
|
930 | ||
|
923 | 931 | def test_principals_options_for_select_with_users |
|
924 | 932 | User.current = nil |
|
925 | 933 | users = [User.find(2), User.find(4)] |
General Comments 0
You need to be logged in to leave comments.
Login now