Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
obs:server:fedora:2.9
obs-server
obs-server-2.9-0102-frontend-Rails-5.2-Add-a-pr...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File obs-server-2.9-0102-frontend-Rails-5.2-Add-a-prefix-to-kiwi-preference-e.patch of Package obs-server
From e23ea8ee26c2cb9a141891df214c2e1a4bdbf1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Geuken?= <bgeuken@suse.de> Date: Tue, 22 May 2018 16:48:15 +0200 Subject: [PATCH] [frontend] Rails 5.2: Add a prefix to kiwi preference enum With the recent rails update we started to get an error message: 'You tried to define an enum named "type_image" on the model "Kiwi::Preference", but this will generate a class method "split", which is already defined by ActiveRecord::Relation. (ArgumentError) ' The solution to that is to define a prefix for that enumaration. This prefix will be added to any helper method generated by the enum library, eg. my_preference.image_type_split? instead of my_preference.split?. --- src/api/app/models/kiwi/preference.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/app/models/kiwi/preference.rb b/src/api/app/models/kiwi/preference.rb index 6da4718bbd..96b05bcd07 100644 --- a/src/api/app/models/kiwi/preference.rb +++ b/src/api/app/models/kiwi/preference.rb @@ -2,7 +2,7 @@ class Kiwi::Preference < ApplicationRecord belongs_to :image, inverse_of: :preference enum type_image: [:btrfs, :clicfs, :cpio, :docker, :ext2, :ext3, :ext4, :iso, :lxc, :oem, - :product, :pxe, :reiserfs, :split, :squashfs, :tbz, :vmx, :xfs, :zfs] + :product, :pxe, :reiserfs, :split, :squashfs, :tbz, :vmx, :xfs, :zfs], _prefix: :image_type validates :type_image, inclusion: { in: type_images.keys }, allow_nil: true -- 2.25.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor