From 0bc78329eff4d66413ce28f47b4858aeb0fbe979 Mon Sep 17 00:00:00 2001 From: Miles Georgi Date: Tue, 3 Dec 2024 12:35:49 -0800 Subject: [PATCH] Make entities imported as models be immutable --- CHANGELOG.md | 4 ++-- Gemfile.lock | 4 ++-- spec/foobara/remote_imports/another_import_command_spec.rb | 3 +++ src/foobara/remote_imports/import_type.rb | 1 + version.rb | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0e31aa..1a69d56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ -## [0.0.3] - 2024-12-03 +## [0.0.4] - 2024-12-03 -- Convert entities into models +- Convert entities into immutable models ## [0.0.2] - 2024-12-02 diff --git a/Gemfile.lock b/Gemfile.lock index dd17c46..ec25c3d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,7 +8,7 @@ GIT PATH remote: . specs: - foobara-remote-imports (0.0.3) + foobara-remote-imports (0.0.4) foobara GEM @@ -28,7 +28,7 @@ GEM docile (1.4.1) dotenv (3.1.4) ffi (1.17.0-x86_64-linux-gnu) - foobara (0.0.22) + foobara (0.0.23) foobara-util foobara-rubocop-rules (0.0.5) rubocop diff --git a/spec/foobara/remote_imports/another_import_command_spec.rb b/spec/foobara/remote_imports/another_import_command_spec.rb index e3a205c..841b9db 100644 --- a/spec/foobara/remote_imports/another_import_command_spec.rb +++ b/spec/foobara/remote_imports/another_import_command_spec.rb @@ -33,5 +33,8 @@ expect(Capybara).to be < Foobara::Model expect(Capybara).to_not be < Foobara::Entity + capybara = Capybara.new(name: "Fumiko", age: 300, id: 1) + + expect(capybara.mutable).to be false end end diff --git a/src/foobara/remote_imports/import_type.rb b/src/foobara/remote_imports/import_type.rb index 2f1c2b8..f261f5c 100644 --- a/src/foobara/remote_imports/import_type.rb +++ b/src/foobara/remote_imports/import_type.rb @@ -89,6 +89,7 @@ def entity_to_model(declaration_data) declaration_data["type"] = "model" declaration_data["model_base_class"] = "Foobara::Model" + declaration_data["mutable"] = false declaration_data["attributes_declaration"]["element_type_declarations"][primary_key_attribute]["required"] = true diff --git a/version.rb b/version.rb index 98ab45f..1094231 100644 --- a/version.rb +++ b/version.rb @@ -1,5 +1,5 @@ module Foobara module RemoteImports - VERSION = "0.0.3".freeze + VERSION = "0.0.4".freeze end end