Skip to content

Commit

Permalink
PAUSED: Use git resume to continue working.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrafanie committed Oct 11, 2024
1 parent 488b6ab commit f5f2d41
Show file tree
Hide file tree
Showing 34 changed files with 36 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class MoveZoneNtpSettingsToSettings < ActiveRecord::Migration[5.0]
class SettingsChange < ActiveRecord::Base
serialize :value
serialize :value, :coder => YAML
end
class Zone < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ConvertQuadiconSettingsKeys < ActiveRecord::Migration[5.0]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class RemoveTransformationProductSetting < ActiveRecord::Migration[5.0]
class SettingsChange < ActiveRecord::Base
serialize :value
serialize :value, :coder => YAML
end

def up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class MiqRequestTask < ActiveRecord::Base
self.inheritance_column = :_type_disabled
include ActiveRecord::IdRegions

serialize :options, :type => Hash
serialize :options, :coder => YAML, :type => Hash
belongs_to :conversion_host, :class_name => "AddConversionHostIdToMiqRequestTasks::ConversionHost"
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class MoveAwxCredentialsToAuthentications < ActiveRecord::Migration[5.0]
class Authentication < ActiveRecord::Base
include ActiveRecord::IdRegions
self.inheritance_column = :_type_disabled
serialize :options
serialize :options, :coder => YAML
end

# This class is port of the code found in both the awx code base, and the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class MoveEmbeddedAnsibleProxySettingToGitRepositoryProxySettings < ActiveRecord::Migration[5.1]
class SettingsChange < ActiveRecord::Base
serialize :value
serialize :value, :coder => YAML
end

def up
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20191002103406_remove_quadicon_settings.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class RemoveQuadiconSettings < ActiveRecord::Migration[5.0]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ReplaceServerCapabilitiesWithVixDiskLib < ActiveRecord::Migration[5.1]
class MiqServer < ActiveRecord::Base
serialize :capabilities
serialize :capabilities, :coder => YAML
include ActiveRecord::IdRegions
end

Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20200331150436_rename_foreman_features.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class RenameForemanFeatures < ActiveRecord::Migration[5.1]
class MiqProductFeature < ActiveRecord::Base; end
class MiqRolesFeature < ActiveRecord::Base; end
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

FEATURE_MAPPING = {
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20200512201614_update_chargeback_startpage.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdateChargebackStartpage < ActiveRecord::Migration[5.2]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdateChargebackAssignmentsStartpage < ActiveRecord::Migration[5.2]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
include ActiveRecord::IdRegions
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdateChargebackReportsStartpage < ActiveRecord::Migration[5.2]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
include ActiveRecord::IdRegions
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class AdjustControlExplorerStartpageEntries < ActiveRecord::Migration[5.2]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdateStartupShortcutAfterPolicyProfileDeexplorization < ActiveRecord::Migration[5.2]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdateStartpageShortcutAfterActionsDeExplorization < ActiveRecord::Migration[5.2]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdatePolicyStartpageUrlAfterDeExplorization < ActiveRecord::Migration[5.2]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdatePolicyRsopStartpageUrl < ActiveRecord::Migration[5.2]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdatePolicyExportStartpageUrl < ActiveRecord::Migration[5.2]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdatePolicyLogStartpageUrl < ActiveRecord::Migration[5.2]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdateAlertsStartpageUrlAfterDeExplorization < ActiveRecord::Migration[6.0]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdateAlertProfilesStartpageUrlAfterDeExplorization < ActiveRecord::Migration[6.0]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdateEventsStartpageUrlAfterDeExplorization < ActiveRecord::Migration[6.0]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdateConditionsStartpageUrlAfterDeExplorization < ActiveRecord::Migration[6.0]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdateAutomationProviderStartpage < ActiveRecord::Migration[6.0]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20210330012001_remove_regex_from_settings.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class RemoveRegexFromSettings < ActiveRecord::Migration[6.0]
class SettingsChange < ActiveRecord::Base
serialize :value
serialize :value, :coder => YAML
end

def up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class RemoveCol3FromMiqWidgetSet < ActiveRecord::Migration[6.0]
class MiqWidgetSet < ActiveRecord::Base
include ActiveRecord::IdRegions
self.table_name = "miq_sets"
serialize :set_data
serialize :set_data, :coder => YAML
end

def up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Authentication < ActiveRecord::Base
include ActiveRecord::IdRegions
self.inheritance_column = :_type_disabled

serialize :options
serialize :options, :coder => YAML
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UpdateStartpageShortcutAfterServicesDeExplorization < ActiveRecord::Migration[6.0]
class User < ActiveRecord::Base
serialize :settings, :type => Hash
serialize :settings, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MiqRequest < ActiveRecord::Base

self.inheritance_column = :_type_disabled

serialize :options, :type => Hash
serialize :options, :coder => YAML, :type => Hash
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class SeparateRoleAccessRestrictionsForServiceTemplates < ActiveRecord::Migration[6.0]
class MiqUserRole < ActiveRecord::Base
serialize :settings
serialize :settings, :coder => YAML
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class AddVaultCredentialIdToOptionsInServiceTemplates < ActiveRecord::Migration[6.1]
class ServiceTemplate < ActiveRecord::Base
self.inheritance_column = :_type_disabled
serialize :options
serialize :options, :coder => YAML
end

def up
Expand Down
6 changes: 3 additions & 3 deletions lib/manageiq/schema/serialize_positional_to_kwargs_bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ def serialize(*args, **options)

# For rails 7.0.x, convert 7.1+ kwargs for coder/type into the positional argument
# class_name_or_coder
if options[:coder]
args << options.delete(:coder)
elsif options[:type]
if options[:type]
args << options.delete(:type)
elsif options[:coder]
args << options.delete(:coder)
end

super(*args, **options)
Expand Down
5 changes: 0 additions & 5 deletions spec/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ class Application < Rails::Application
# migration specs to honor it.
config.active_record.belongs_to_required_by_default = false

# Note, you can't pass kwargs :coder => YAML to serialize until rails 7.1 as it was a positional
# argument previously. To avoid a case statement in all usages of serialize, we're defaulting
# all serialized columns to YAML for rails 7.1+ here. Ideally, we would use JSON if we find we can
# use a simpler datatype. See: https://github.com/rails/rails/pull/47463
config.active_record.default_column_serializer = YAML if Rails.version >= "7.1"
config.active_record.use_yaml_unsafe_load = true
end
end
2 changes: 1 addition & 1 deletion spec/support/migration_stubs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def self.reserved_stub
Class.new(ActiveRecord::Base) do
self.table_name = "reserves"
self.inheritance_column = :_type_disabled # disable STI
serialize :reserved
serialize :reserved, :coder => YAML
end
end
end
Expand Down

0 comments on commit f5f2d41

Please sign in to comment.