@@ -274,7 +274,7 class Project < ActiveRecord::Base | |||||
274 |
|
274 | |||
275 | def to_param |
|
275 | def to_param | |
276 | # id is used for projects with a numeric identifier (compatibility) |
|
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 | end |
|
278 | end | |
279 |
|
279 | |||
280 | def active? |
|
280 | def active? |
@@ -920,6 +920,14 RAW | |||||
920 | link_to_project(project, {:action => 'settings'}, :class => "project") |
|
920 | link_to_project(project, {:action => 'settings'}, :class => "project") | |
921 | end |
|
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 | def test_principals_options_for_select_with_users |
|
931 | def test_principals_options_for_select_with_users | |
924 | User.current = nil |
|
932 | User.current = nil | |
925 | users = [User.find(2), User.find(4)] |
|
933 | users = [User.find(2), User.find(4)] |
General Comments 0
You need to be logged in to leave comments.
Login now