小编use*_*962的帖子

通过has_many找到Rails:through

我正在寻找一种方法来查询基于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)

ruby activerecord ruby-on-rails

5
推荐指数
1
解决办法
4031
查看次数

顶部的 Cordova iOS 白条

将 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

在此处输入图片说明

webview ios cordova

5
推荐指数
2
解决办法
3485
查看次数

标签 统计

activerecord ×1

cordova ×1

ios ×1

ruby ×1

ruby-on-rails ×1

webview ×1