tech(ActiveModel.types.json): renomme en simple_json pour eviter la confusion avec ActiveRecord.types.json
This commit is contained in:
parent
ffdd7ee95d
commit
a4ef3cdf23
3 changed files with 5 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -50,7 +50,6 @@ class APIBretagneService
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
def call(url:, params:)
|
||||
API::Client.new.(url:, params:, authorization_token:, method:)
|
||||
end
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue