プロジェクト

全般

プロフィール

Vote #65878

完了

Rename named_scope :public for Project to something else

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Projects_11
対象バージョン:
開始日:
2009/10/19
期日:
進捗率:

100%

予定工数:
category_id:
11
version_id:
6
issue_org_id:
4056
author_id:
7317
assigned_to_id:
5
comments:
3
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

As the word public is reserved in ruby, the attempt to mock/stub the model Project fails, since the line that introduces a new public method fails due to the fact that word 'public' is redefined by the named_scope.

I suspect you may meet the case while setting up the shoulda.


journals

Agreed. I ran into this when I would mock @Project.public@ in my tests. What do you propose renaming it to? Project.public_projects? Project.all_public?
--------------------------------------------------------------------------------
I think :all_public is pretty good. As a variant I was thinking about :public_state. :-)
--------------------------------------------------------------------------------
@Project.all_public@ it is. Thanks for the suggestion. r2941
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリProjects_11 にセット
  • 対象バージョン0.9.0_6 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0