Skip to content

Commit

Permalink
Make entities imported as models be immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
azimux committed Dec 3, 2024
1 parent c0c8f8a commit 0bc7832
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GIT
PATH
remote: .
specs:
foobara-remote-imports (0.0.3)
foobara-remote-imports (0.0.4)
foobara

GEM
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions spec/foobara/remote_imports/another_import_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions src/foobara/remote_imports/import_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Foobara
module RemoteImports
VERSION = "0.0.3".freeze
VERSION = "0.0.4".freeze
end
end

0 comments on commit 0bc7832

Please sign in to comment.