From 8333cd9e69eb41502fdb6eadc06b2451b0ee0b84 Mon Sep 17 00:00:00 2001 From: Sean Edge Date: Mon, 8 Jul 2024 16:56:41 -0400 Subject: [PATCH 1/2] Add missing standard type for `ContentNote` and fix the way the model generator handles the `name` input so it acts a bit more predictably. --- lib/active_force/standard_types.rb | 5 +++-- lib/generators/active_force/model/model_generator.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/active_force/standard_types.rb b/lib/active_force/standard_types.rb index 212df70..5c1fc88 100644 --- a/lib/active_force/standard_types.rb +++ b/lib/active_force/standard_types.rb @@ -1,5 +1,5 @@ module StandardTypes - STANDARD_TYPES = %w[ + STANDARD_TYPES = %w[ Account Asset AssetFeed @@ -67,6 +67,7 @@ module StandardTypes ContentDocumentFeed ContentDocumentHistory ContentDocumentLink + ContentNote ContentVersion ContentVersionHistory ContentWorkspace @@ -352,6 +353,6 @@ module StandardTypes WorkRewardHistory WorkRewardShare WorkThanks - WorkThanksShare + WorkThanksShare ] end diff --git a/lib/generators/active_force/model/model_generator.rb b/lib/generators/active_force/model/model_generator.rb index 54ba25b..38f2ac1 100644 --- a/lib/generators/active_force/model/model_generator.rb +++ b/lib/generators/active_force/model/model_generator.rb @@ -16,7 +16,7 @@ class ModelGenerator < Rails::Generators::NamedBase } def create_model_file - @table_name = file_name.capitalize + @table_name = name @class_name = prepare_namespace + @table_name.gsub('__c', '') template "model.rb.erb", "app/models/#{@class_name.underscore}.rb" if table_exists? end From 89f0c86f1226b5e11e8513a739f1e54a0bc91c80 Mon Sep 17 00:00:00 2001 From: Sean Edge Date: Mon, 8 Jul 2024 16:58:15 -0400 Subject: [PATCH 2/2] Update CHANGELOG. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29205ed..46a3f19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Not released - Add `ids` method to ActiveQuery interface (https://github.com/Beyond-Finance/active_force/pull/94) +- Add missing standard type for ContentNote and fix the way the model generator handles the name input so it acts a bit more predictably. (https://github.com/Beyond-Finance/active_force/pull/95) ## 0.21.1 - Fixes #91. Applies scopes to eager-loaded associations when they are nested. (https://github.com/Beyond-Finance/active_force/pull/92)