- Porting plugins to Redmine 3
Query interface changes¶
- And so on.
.find(:all) should be replaced with just
.find_all_by_* should be replaced with
Observers were removed¶
All things, you did before using observers, now should be done directly in models, e.g., by monkey-patching them.
^ and $ in regexps¶
The system does not allow
$ in regular expressions any longer - you should replace them with
Attributes assignment protection¶
In Rails 4 you have to use either
attr_protected (seems to be preferred by Redmine guys) to white-list or black-list attributes for mass assignment.
Otherwise you are going to get:
WARNING: Can't mass-assign protected attributes for YourModelClass: attribute1, attribute2
Update should use PATCH now¶
Rails guys decided, that the
PATCH HTTP method sounds better for update, so everyone is now forced to switch from
Certainly, you could modify the code to still use
PUT, but I would not go this way (as it’s going to be non-standard since Rails 4)...