oj icon indicating copy to clipboard operation
oj copied to clipboard

Missing argument 'options' in RubyMine IDE

Open OlegsBoldirevs opened this issue 6 years ago • 6 comments

How can i avoid passing mode: :compat argument for Oj.load and Oj.dump ?

This is what i got right now: Oj.load(json, mode: :compat) This is what i'm looking to achieve: Oj.load(json) But my RubyMine IDE is throwing error "Missing argument 'options'"

I've tried creating initializer with Oj.default_options = {:mode => :compat } but still get error from IDE. Screenshot 2020-04-20 at 14 51 44

OlegsBoldirevs avatar Apr 20 '20 12:04 OlegsBoldirevs

Sounds like a bug in RubyMine. The second argument is optional.

ohler55 avatar Apr 20 '20 12:04 ohler55

Well i figured it out. In Oj version 3.10.5 the second argument is required although in version 3.10.6 second argument is optional. I updated version of Oj and the problem is not relevant anymore.

OlegsBoldirevs avatar Apr 20 '20 12:04 OlegsBoldirevs

That is odd. That code hasn't changed in a very long time.

ohler55 avatar Apr 20 '20 12:04 ohler55

Hm. This is what my IDE looks for. 3.10.6 Screenshot 2020-04-20 at 15 24 40 3.10.5 Screenshot 2020-04-20 at 15 24 29

OlegsBoldirevs avatar Apr 20 '20 12:04 OlegsBoldirevs

Well i don't see any changelog changes from 3.10.5 to 3.10.6 that might affect this. Probably RubyMine bug.

OlegsBoldirevs avatar Apr 20 '20 12:04 OlegsBoldirevs

I don't know where that file, oj.rb is from. It is not part of the Oj gem. Maybe RubyMine generates it from the documentation in the C source file or from the generated docs.

ohler55 avatar Apr 20 '20 12:04 ohler55