我正在寻找一种方法来查询基于has_many通过关联的子项的模型.
我有3个型号:
class Conversation < ActiveRecord::Base
has_many :conversations_participants
has_many :participants, through: :conversations_participants
end
class ConversationsParticipant < ActiveRecord::Base
belongs_to :conversation
belongs_to :participant, class_name: 'User'
end
class User < ActiveRecord::Base
has_many :conversations_participants
has_many :conversations, through: :conversations_participants
end
Run Code Online (Sandbox Code Playgroud)
我需要找到参与者匹配一组id的对话.
这就是我现在所拥有的(不工作):
Conversation.includes(:participants).where(participants: params[:participants])
Run Code Online (Sandbox Code Playgroud) 将 StatusBarOverlaysWebview 添加到 config.xml 后,我在屏幕顶部看到一个白条,所有内容都被向下推(参见屏幕截图 - 状态栏顶部有一个白条)。因此,它不仅将状态栏高度 (20px) 添加到屏幕上,还添加了 40px。
我仔细检查了我所有的样式,一切看起来都很好,所以我猜它是由插件引起的。谁能告诉我如何解决这个问题?
这是我的配置:
<preference name="StatusBarOverlaysWebview" value="false" />
<preference name="StatusBarBackgroundColor" value="#FF543E" />
<preference name="fullscreen" value="true" />
Run Code Online (Sandbox Code Playgroud)
这是没有设置颜色和使用 window.StatusBar.overlaysWebView(false) 的样子;而不是 config.xml