简体   繁体   English

在Ruby on Rails中查看ActiveRecord模型字段

[英]Viewing ActiveRecord model fields in Ruby on Rails

I'm new to Ruby and I come from a C# background so apologies if this is very basic. 我是Ruby的新手,我来自C#背景,因此很抱歉,如果这很基础。 I'm navigating around a large Rails project and looking at the model (ActiveRecord) classes. 我正在浏览一个大型的Rails项目,并查看模型(ActiveRecord)类。 I want to be able to easily see all of the fields of a class so that I can see whether a particular class has the fields that I need. 我希望能够轻松查看类的所有字段,以便可以查看特定类是否具有所需的字段。 I can't find any way of doing this in the RubyMine IDE. 我在RubyMine IDE中找不到执行此操作的任何方法。 Is there any easy way or am I misunderstanding the way that dynamic languages work? 有什么简单的方法还是我误解了动态语言的工作方式? The only way that I have found so far is by looking at the underlying database tables. 到目前为止,我发现的唯一方法是查看基础数据库表。

TIA TIA

您可以查看db文件夹下的schema.rb。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM