RubyMine and Rails Associations Question

This is a bit more complicated than my previous question, so I'm hoping some one can help me make sense of it :)

I really like the attribute identification support that RubyMine has - it helps me avoid typos and errors quite a bit.  But I'm working on setting up some Machinist Blueprints (fixture replacement) and having some trouble with RM seeing a "belongs_to" association as an invalid attribute.  For example:

ServerType.blueprint do
  name
end


Server.blueprint do
  name
  server_type { ServerType.make }
end



# The models:

class Server < ActiveRecord::Base
  belongs_to :server_type
end




class ServerType < ActiveRecord::Base
  # just has a name and an id
end

When I define the blueprint (above) in RubyMine, it does the fuzzy-underline on the server_type attribute, saying that it can't actually "resolve" that (my wording).  Clearly it does work, however.  So my question is, how can I get RM to properly identify that association and not display an inspector warning?

Thanks!
2 comments
Comment actions Permalink

Hi John,

At the moment you may only force RubyMine to hide a warning in this place. You need place caret on highlighted word (e.g server_type in blueprint block), then press "alt+enter" and choose "suppress" option.
Also please submit a feature request at http://youtrack.jetbrains.net/issues/ruby.

P.S: At the moment RubyMine code analyzer engine doesn't know about runtime semantics of method ServerType.blueprint and that it is related to rails associations, so RubyMine consider it as ordinary Ruby call.

0
Comment actions Permalink

Thank you very much for your help.  It's appreciated!

0

Please sign in to leave a comment.