开发者

What is the fully qualified namespace for an ActiveRecord model?

开发者 https://www.devze.com 2023-03-28 22:06 出处:网络
I need to call a method on a model from within a g开发者_开发百科em. Therefore I need to know the fully qualified name for a model, from ::Rails on down... Anyone know what it is?There isn\'t a namesp

I need to call a method on a model from within a g开发者_开发百科em. Therefore I need to know the fully qualified name for a model, from ::Rails on down... Anyone know what it is?


There isn't a namespace around ActiveRecord models loaded into a Rails project unless you explicitly declare one.

For example, if you have a User model it will not be namespaced unless declared as such.

0

精彩评论

暂无评论...
验证码 换一张
取 消