In a new, vanilla Rails project, RubyMine knows about a model's fields. In my project; Rails only For example, in the Model Dependency Diagram I see associations (belongs_to, has_many, etc.), but no fields that correspond to database columns, either magic (e.g. id, created_at) or regular old data columns. I also see a warning everywhere the code refers to an accessor method that corresponds to a data column. What does it take for RubyMine to understand that a model has a field?
I'm using RubyMine 3.0.1, Rails 2.3.10, mysql 5.1, and the mysql2 gem 0.2.6 on a Mac. In general RubyMine seems to be running fine, and the app runs fine inside RubyMine. In particular, config/database.yml is there as it should be and the app and tests use it as expected.
A couple of possibilities:
- environment.rb has config.active_record.schema_format = :sql (since I use mysql schema features that the Ruby format doesn't support); does RubyMine care about that?
- the app doesn't have migrations going back to the beginning of time, and some migrations use execute "sql"; does RubyMine care about that?
Those are just wild guesses; I really have no idea what RubyMine needs.