Fixing problem while executing in rails 3.2.19

Running the plugin under Redmine 2.6.0 and rails 3.2.19 I get the message 

undefined method `order' for #<Array:0x718c278>

With these changes, I have fixed the error