ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Enhance Redmine::SafeAttributes to work for subclasses (Bug #282)


Added by Gregor Schmidt at 2011-03-14 04:47 pm. Updated at 2011-03-19 09:27 pm.


Status:Closed Start date:2011-03-14
Priority:Normal Due date:
Assignee:Eric Davis % Done:

0%

Category:-
Target version:1.2.0
Remote issue URL: Affected version:

Description

ChiliProject uses Redmine::SafeAttributes to implement a more flexible version of attr_protected. Unfortunately it does not work well with subclasses. It would be great, if SafeAttributes would support that.

Expected behavior would be:

  • sub classes have the same safe attributes as their super classes
  • sub classes may have their own safe attributes, that are not safe in their super class

Also, while we are at it, I would like to allow the usage of Symbol keys when calling safe_attributes=.

Pull Request will be provided immediately.


Associated revisions

Revision b5b36844
Added by Gregor Schmidt at 2011-03-14 05:49 pm

[#282] Make safe_attributes work with sub classes

Revision 0320517d
Added by Gregor Schmidt at 2011-03-14 05:50 pm

[#282] Make safe_attributes work with symbol keys

History

Updated by Gregor Schmidt at 2011-03-14 04:53 pm

  • Assignee deleted (Gregor Schmidt)
  • Status changed from Open to Ready for review

Updated by Gregor Schmidt at 2011-03-14 05:11 pm

FYI: redmine_backlogs has an Issue sub class named Task.

Updated by Eric Davis at 2011-03-14 09:05 pm

I'd rather remove safe_attributes completely. See https://www.chiliproject.org/boards/2/topics/68

Updated by Gregor Schmidt at 2011-03-14 09:52 pm

I've dropped my thoughts there. While that conversation is going on, would you consider this pull request anyway?

IMHO, this ticket could be a candidate for 1.2, removing safe_attributes is more for a major release.

Thanks

Gregor

Updated by Eric Davis at 2011-03-14 10:40 pm

Gregor Schmidt wrote:

IMHO, this ticket could be a candidate for 1.2, removing safe_attributes is more for a major release.

I did a quick skim of the code, it's looks low impact enough to be in 1.2. I'll merge it into master once I'm able to run all the tests on it (or someone else can merge it if they get a chance).

  • Target version set to 1.2.0

Updated by Eric Davis at 2011-03-19 08:05 pm

Tests passed, merged into master.

One thing to watch in the future: name new tests using the Rails test "description of test" style instead of the def test_description style. It's a little thing but over time we want to move over to the new style and take advantage of shared contexts too (Code Review).

  • Assignee set to Eric Davis
  • Tracker changed from Feature to Bug
  • Status changed from Ready for review to Closed

Updated by Gregor Schmidt at 2011-03-19 09:27 pm

Thanks for merging the changes into 1.2.

Eric Davis wrote:

One thing to watch in the future: name new tests using the Rails test "description of test" style instead of the def test_description style. It's a little thing but over time we want to move over to the new style and take advantage of shared contexts too (Code Review).

Thanks for pointing that out. I'll use the new style next time.

Gregor

Also available in: Atom PDF