Cannot find 'xxxxxxx' warning

I'm running Rubymine EAP 95.314 on Ubuntu and developing with Rails 3. I noticed that this code...

class Person
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::Versioning

  field :first_name, :type => String
  field :middle_names, :type => String
  field :last_name, :type => String

  def full_name
    first_name + ' ' +
      (!middle_names.blank? ? middle_names + ' ' : '') +
      (!last_name.blank? ? last_name : '')
  end

end

... gives 'cannot find' warnings for first_name, middle_names and last_name in the full_name method, however the code seems to work. I'n new to all this so I'm wondering if I'm writing this in a non-standard way that just happens to work or if there's a problem with the RubyMine parser.
1 comment
Comment actions Permalink

Hello Jerome,

RubyMine doesn't have any specific support for Mongoid, and because of that
it doesn't know about the accessors which are dynamically generated from
the 'field' declarations. You can file a feature request at http://youtrack.jetbrains.net/
asking for Mongoid support in RubyMine.

I'm running Rubymine EAP 95.314 on Ubuntu and developing with Rails 3.
I noticed that this code...

class Person
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Versioning
field :first_name, :type => String
field :middle_names, :type => String
field :last_name, :type => String
def full_name
first_name + ' ' +
(!middle_names.blank? ? middle_names + ' ' : '') +
(!last_name.blank? ? last_name : '')
end
end

.. gives 'cannot find' warnings for first_name, middle_names and
last_name in the full_name method, however the code seems to work. I'n
new to all this so I'm wondering if I'm writing this in a non-standard
way that just happens to work or if there's a problem with the
RubyMine parser.

---
Original message URL:
http://www.jetbrains.net/devnet/message/5265383#5265383

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.