Merge pull request #295 from abf/rosa-build:fix-platform-arch-settings
Fix: platform-arch-settings
This commit is contained in:
commit
7196b2e201
|
@ -11,8 +11,13 @@ module PlatformsHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def platform_arch_settings(platform)
|
def platform_arch_settings(platform)
|
||||||
settings = platform.platform_arch_settings
|
settings = platform.platform_arch_settings
|
||||||
settings |= Arch.where('id not in (?)', settings.map(&:arch_id)).map do |arch|
|
arches = if arch_ids = settings.map(&:arch_id) && arch_ids.present?
|
||||||
|
Arch.where('id not in (?)', arch_ids)
|
||||||
|
else
|
||||||
|
Arch.all
|
||||||
|
end
|
||||||
|
settings |= arches.map do |arch|
|
||||||
platform.platform_arch_settings.build(
|
platform.platform_arch_settings.build(
|
||||||
:arch_id => arch.id,
|
:arch_id => arch.id,
|
||||||
:time_living => PlatformArchSetting::DEFAULT_TIME_LIVING
|
:time_living => PlatformArchSetting::DEFAULT_TIME_LIVING
|
||||||
|
|
Loading…
Reference in New Issue