Rails 4关系问题,登录时
我不确定在尝试登录时遇到此错误会发生什么变化:
ERROR: relation "tags" does not exist LINE 1: SELECT DISTINCT "tags".* FROM "tags" INNER JOIN "taggings" O...
标签模型:
class Tag < ActiveRecord::Base attr_accessor :unread_count, :user_feeds has_many :taggings has_many :feeds, through: :taggings end
标记模型:
class Tagging < ActiveRecord::Base belongs_to :tag belongs_to :feed belongs_to :user end
和用户关系:
class User < ActiveRecord::Base has_one :coupon has_many :subscriptions, dependent: :delete_all has_many :feeds, through: :subscriptions has_many :entries, through: :feeds has_many :imports, dependent: :destroy has_many :billing_events, as: :billable, dependent: :delete_all has_many :taggings, dependent: :delete_all has_many :tags, through: :taggings has_many :sharing_services, dependent: :delete_all has_many :unread_entries, dependent: :delete_all has_many :starred_entries, dependent: :delete_all has_many :saved_searches, dependent: :delete_all has_many :actions, dependent: :destroy belongs_to :plan end
这个错误是新的,在我尝试安装intercom.io gem后就出现了。 我删除了gem,做了一个gem清理,重置db并仍然出现同样的错误。
不确定发生了什么,如果有人有任何建议我会很感激。
检查丢失的表,这就是问题所在。
- Rails中的多个查询条件 – 如果存在的话。
- Bootstrap-sass gem Javascript无法在Rails中工作4
- 迭代数据库中的每条记录 – Ruby on Rails / ActiveRecord
- 无法在Rubymine中启动调试器。 在项目中找不到Rails服务器启动器
- instagram api – 神秘的回应; 不确定是否工作,无法用此测试omniauth
- Rails 4.1.2 – to_param转义斜杠(并打破app)
- 我们可以找到Paperclip下载完成的时间吗?
- ActiveModel :: SecurePassword未定义方法`password_digest =’
- 在Ruby on Rails项目中查找内存泄漏