0

Any Ideas what means this error ?

ActiveRecord::DangerousAttributeError (delay is defined by ActiveRecord):
app/models/issue.rb:849:in `relations'
app/controllers/issues_controller.rb:118:in `show'

Thanks

3 Answers3

4

Dude, are you using the sidekiq gem? Sidekiq uses a method called "delay" which is causing this problem. Removing the sidekiq gem will solve your issue, OR,

Just put this in your Gemfile:

    gem 'safe_attributes'

and do bundle install

More info: here and solutions can be found here

UPDATE: Alternatively, you could also install the redmine_sidekiq plugin which also solves the problem.

UPDATE-2: Have created a fork of sidekiq gem which solves the problem. Kindly find it here. Follow the instructions in the pull request.

Hope this helps !

Community
  • 1
  • 1
Devaroop
  • 7,900
  • 2
  • 37
  • 34
0

You probably have delay column in Issue model. You should rename it, because this name is used internally by ActiveRecord.

Marek Lipka
  • 50,622
  • 7
  • 87
  • 91
0

From the documentation, this error is "raised when attribute has a name reserved by Active Record (when attribute has name of one of Active Record instance methods)."

So basically the attribute delay is one that is reserved by ActiveRecord and it would be a good idea to call it something else, or you will run into naming conflicts.

omnikron
  • 2,211
  • 17
  • 30
  • Thanks omnikron, but i'am using redmine and i'cant rename this attribute, can i have any other solution do resolve this conflict. – The Great Gatsby Mar 24 '14 at 15:32
  • can you show the relevant code in `app/models/issue.rb:849`? – omnikron Mar 24 '14 at 16:05
  • @relations ||= (relations_from + relations_to).sort and the attribute delay is in the table relations_issues – The Great Gatsby Mar 24 '14 at 16:18
  • Hmm, that doesn't really help to diagnose the problem, but you could try using the gem mentioned in [this answer](http://stackoverflow.com/questions/1510875/how-can-i-use-activerecord-on-a-database-that-has-a-column-named-valid-dange/9106597#9106597) on a similar question. – omnikron Mar 25 '14 at 13:48