Coder Social home page Coder Social logo

Comments (3)

nounderline avatar nounderline commented on May 18, 2024

Error is caused by this line: https://github.com/rgtk/redmine_editauthor/blob/9ac40cee9c0e6c293a8401b9b71dd70c3475e990/lib/redmine_editauthor/hook.rb#L22

It happens because possible_authors returns User::ActiveRecord_Relation and I am calling unshift method commonly found in Array which Relation is clearly not.

Silly me. Why would I write a code that doesn't work?

It works, but for older version of Rails (framework Redmine use). It seems you use Rails 5.x. I have tested and used this plugin for 3-4.x.

The way to fix it is to convert Relation to an Array which you can do by calling to_a on it:
authors = possible_authors(issue.project).to_a

I have not tested it but it should work. Try it! And maybe create pull request? 😉

from redmine_editauthor.

xurizaemon avatar xurizaemon commented on May 18, 2024

Done 😁 thanks for the feedback and quick response!

Your proposed fix seems to solve the issue for me.

from redmine_editauthor.

nounderline avatar nounderline commented on May 18, 2024

Thanks.

from redmine_editauthor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.