我正在尝试使用以下hdutil命令构建dmg的.app文件:
hdiutil create -srcfolder /Users/me/My.app My.dmg
Run Code Online (Sandbox Code Playgroud)
它正常工作,因为它正确创建My.dmg.在调用hdutil命令之前,我将另外两个文件添加到.app包中时,问题就开始了.hdutil最终出错:
diskimages-helper: resize request is above maximum size allowed.
hdiutil: create failed - Invalid argument
Run Code Online (Sandbox Code Playgroud)
感谢您的任何帮助,您可以提供.
我想模拟关联OR条件,has_many这样我就不会丢失活动记录关联。我知道这可以使用scope或实例方法来实现,但在这种情况下,我将失去关联。
class Game < ActiveRecord::Base
belongs_to :home_team, :class_name => "Team"
belongs_to :away_team, :class_name => "Team"
has_many :sponsors
end
class Sponsor < ActiveReord::Base
belongs_to :game
end
class Team < ActiveRecord::Base
has_many :away_games, :class_name => "Game", :foreign_key => "away_team_id"
has_many :home_games, :class_name => "Game", :foreign_key => "home_team_id"
# what I want here like:
# has_many :games, :foreign_key => [:home_team_id, :away_team_id]
# so I could achieve without losing association helper:
# has_many :sponsors through: :games
end
Run Code Online (Sandbox Code Playgroud)