tech(ActiveModel.types.json): renomme en simple_json pour eviter la confusion avec ActiveRecord.types.json

This commit is contained in:
Martin 2023-10-19 08:55:01 +02:00
parent ffdd7ee95d
commit a4ef3cdf23
3 changed files with 5 additions and 6 deletions

View file

@ -2,9 +2,9 @@ class ChorusConfiguration
include ActiveModel::Model
include ActiveModel::Attributes
attribute :centre_de_coup, :json, default: '{}'
attribute :domaine_fonctionnel, :json, default: '{}'
attribute :referentiel_de_programmation, :json, default: '{}'
attribute :centre_de_coup, :simple_json, default: '{}'
attribute :domaine_fonctionnel, :simple_json, default: '{}'
attribute :referentiel_de_programmation, :simple_json, default: '{}'
def format_displayed_value(attribute_name)
case attribute_name

View file

@ -50,7 +50,6 @@ class APIBretagneService
end
end
def call(url:, params:)
API::Client.new.(url:, params:, authorization_token:, method:)
end

View file

@ -1,4 +1,4 @@
class JsonType < ActiveModel::Type::Value
class SimpleJsonType < ActiveModel::Type::Value
def cast(value)
return nil if value.blank?
return value if value.is_a?(Hash)
@ -8,4 +8,4 @@ class JsonType < ActiveModel::Type::Value
end
end
ActiveModel::Type.register(:json, JsonType)
ActiveModel::Type.register(:simple_json, SimpleJsonType)