lesli 5.1.13 → 5.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/lesli/application_lesli_controller.rb +27 -0
  3. data/app/controllers/lesli/items/attachments_controller.rb +3 -3
  4. data/app/controllers/lesli/items/discussions_controller.rb +2 -2
  5. data/app/controllers/lesli/items/tasks_controller.rb +2 -2
  6. data/app/controllers/lesli/roles_controller.rb +1 -6
  7. data/app/controllers/lesli/users_controller.rb +1 -5
  8. data/app/helpers/lesli/announcements_helper.rb +14 -0
  9. data/app/helpers/lesli/navigation_helper.rb +1 -1
  10. data/app/interfaces/lesli/responder_interface.rb +11 -4
  11. data/app/models/concerns/lesli/account_initializer.rb +5 -45
  12. data/app/models/concerns/lesli/user_extensions.rb +4 -2
  13. data/app/models/lesli/items/attachment.rb +3 -3
  14. data/app/models/lesli/role.rb +14 -2
  15. data/app/models/lesli/user.rb +7 -0
  16. data/app/operators/lesli/account_operator.rb +84 -0
  17. data/app/operators/lesli/resource_operator.rb +123 -0
  18. data/app/services/lesli/application_lesli_service.rb +33 -116
  19. data/app/services/lesli/resource_service.rb +12 -159
  20. data/app/services/lesli/role_service.rb +11 -229
  21. data/app/services/lesli/user_service.rb +37 -117
  22. data/app/views/lesli/layouts/application-lesli.html.erb +1 -1
  23. data/app/views/lesli/partials/_application-lesli-announcements.html.erb +28 -0
  24. data/app/views/lesli/partials/_application-lesli-header.html.erb +3 -2
  25. data/app/views/lesli/partials/_application-lesli-turbo.html.erb +5 -0
  26. data/config/initializers/lesli.rb +7 -2
  27. data/config/locales/translations.en.yml +57 -48
  28. data/config/locales/translations.es.yml +55 -45
  29. data/db/migrate/v1/0000000210_create_lesli_users.rb +1 -0
  30. data/db/seed/xyz.rb +1 -3
  31. data/lib/generators/lesli/base_generator.rb +41 -3
  32. data/lib/generators/lesli/controller/controller_generator.rb +1 -1
  33. data/lib/generators/lesli/controller/templates/controller.rb.tt +12 -7
  34. data/lib/generators/lesli/model/model_generator.rb +1 -1
  35. data/lib/generators/lesli/resource/resource_generator.rb +290 -0
  36. data/lib/generators/lesli/resource/templates/controller.rb.tt +99 -0
  37. data/lib/generators/lesli/resource/templates/locale.en.yml.tt +13 -0
  38. data/lib/generators/lesli/resource/templates/migration.rb.tt +28 -0
  39. data/lib/generators/lesli/resource/templates/model.rb.tt +38 -0
  40. data/lib/generators/lesli/resource/templates/operator.rb.tt +15 -0
  41. data/lib/generators/lesli/resource/templates/service.rb.tt +52 -0
  42. data/lib/generators/lesli/resource/templates/tests/controller_test.rb.tt +14 -0
  43. data/lib/generators/lesli/resource/templates/tests/model_test.rb.tt +24 -0
  44. data/lib/generators/lesli/resource/templates/tests/operator_test.rb.tt +15 -0
  45. data/lib/generators/lesli/resource/templates/tests/service_test.rb.tt +17 -0
  46. data/lib/generators/lesli/resource/templates/views/_form.html.erb.tt +17 -0
  47. data/lib/generators/lesli/resource/templates/views/edit.html.erb.tt +4 -0
  48. data/lib/generators/lesli/resource/templates/views/index.html.erb.tt +22 -0
  49. data/lib/generators/lesli/resource/templates/views/new.html.erb.tt +4 -0
  50. data/lib/generators/lesli/resource/templates/views/show.html.erb.tt +17 -0
  51. data/lib/generators/lesli/scaffold/scaffold_generator.rb +4 -39
  52. data/lib/generators/lesli/service/service_generator.rb +1 -1
  53. data/lib/generators/lesli/service/templates/service.rb.tt +15 -7
  54. data/lib/generators/lesli/views/views_generator.rb +1 -1
  55. data/lib/generators/lesli_generator.rb +11 -0
  56. data/lib/lesli/courier.rb +66 -34
  57. data/lib/lesli/database_tasks.rb +145 -0
  58. data/lib/lesli/version.rb +2 -2
  59. data/lib/tasks/lesli/db.rake +16 -93
  60. data/lib/tasks/lesli/resources.rake +1 -1
  61. data/readme.md +3 -1
  62. metadata +24 -3
  63. data/app/views/lesli/partials/_application-lesli-sidebar.html.erb +0 -50
@@ -0,0 +1,17 @@
1
+ <%%= render(LesliView::Layout::Container.new("<%= engine_domain_name %>-<%= resource_collection_name %>-#{<%= resource_instance %>.id}")) do %>
2
+ <%%= render(LesliView::Components::Header.new(t("<%= engine_name %>.<%= resource_collection_name %>.show.title"))) %>
3
+ <% if selected_items.any? -%>
4
+ <%%= render(LesliView::Components::Tabs.new(active_tab: "<%= resource_name %>-information")) do |tabs| %>
5
+ <%% tabs.with_tab(id: "<%= resource_name %>-information", title: "Information", icon: "info") do %>
6
+ <%%= render("form") %>
7
+ <%% end %>
8
+ <% selected_items.each do |item| -%>
9
+ <%% tabs.with_tab(id: "<%= resource_name %>-<%= item %>", title: "<%= item.humanize %>", icon: "<%= { "activities" => "search_activity", "attachments" => "attach_file", "discussions" => "forum", "tasks" => "checklist" }.fetch(item) %>") do %>
10
+ <%%= render(LesliView::Items::<%= item.camelize %>.new(<%= resource_instance %>)) %>
11
+ <%% end %>
12
+ <% end -%>
13
+ <%% end %>
14
+ <% else -%>
15
+ <%%= render("form") %>
16
+ <% end -%>
17
+ <%% end %>
@@ -1,47 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "rails/generators"
4
- require_relative "../base_generator"
3
+ require_relative "../resource/resource_generator"
5
4
 
6
5
  module Lesli
7
6
  module Generators
8
- # Main Lesli scaffold generator.
9
- #
10
- # This generator delegates work to the specialized generators.
11
- class ScaffoldGenerator < BaseGenerator
12
- argument :attributes, type: :array, default: [], banner: "field:type field:type"
13
-
14
- def invoke_model_generator
15
- invoke "lesli:model", [name, *attributes]
16
- end
17
-
18
- # Invokes the custom Lesli controller generator.
19
- def invoke_controller_generator
20
- invoke "lesli:controller", [name, *attributes]
21
- end
22
-
23
- # Invokes the custom Lesli service generator.
24
- def invoke_service_generator
25
- invoke "lesli:service", [name, *attributes]
26
- end
27
-
28
- def invoke_views_generator
29
- invoke "lesli:views", [name, *attributes]
30
- end
31
-
32
- def invoke_migration_generator
33
- invoke "active_record:migration", [migration_name, *attributes]
34
- end
35
-
36
- def invoke_route_generator
37
- invoke "resource_route", [resource_collection_name]
38
- end
39
-
40
- private
41
-
42
- def migration_name
43
- "create_#{engine_name}_#{resource_collection_name}"
44
- end
7
+ # Backwards-compatible name for the complete Lesli resource generator.
8
+ class ScaffoldGenerator < ResourceGenerator
9
+ source_root ResourceGenerator.source_root
45
10
  end
46
11
  end
47
12
  end
@@ -25,7 +25,7 @@ module Lesli
25
25
  # app/services/my_engine
26
26
  # app/services/store
27
27
  def service_directory
28
- File.join(ENGINE_ROOT, "app/services", engine_name)
28
+ engine_root.join("app/services", engine_name)
29
29
  end
30
30
 
31
31
  # Returns the final service file path.
@@ -9,8 +9,9 @@ module <%= engine_namespace %>
9
9
  # Build the search hash using only present values.
10
10
  params = { id: id, uid: uid }.compact
11
11
 
12
- # Only perform the lookup when at least one filter is present.
13
- super(scope.find_by(params)) if params.any?
12
+ # An empty search must not return the first record in the account.
13
+ resource = scope.find_by(params) if params.any?
14
+ super(resource)
14
15
  end
15
16
 
16
17
  def index
@@ -19,10 +20,9 @@ module <%= engine_namespace %>
19
20
 
20
21
  def create(<%= params_method_name %>)
21
22
  <%= resource_name %> = current_user.account.<%= engine_domain_name %>.<%= resource_collection_name %>.new(<%= params_method_name %>)
23
+ self.resource = <%= resource_name %>
22
24
 
23
- if <%= resource_name %>.save
24
- self.resource = <%= resource_name %>
25
- else
25
+ unless <%= resource_name %>.save
26
26
  self.error(<%= resource_name %>.errors.full_messages.to_sentence)
27
27
  end
28
28
 
@@ -34,11 +34,19 @@ module <%= engine_namespace %>
34
34
  end
35
35
 
36
36
  def update(params)
37
- self.resource.update(params)
37
+ unless resource.update(params)
38
+ error(resource.errors.full_messages.to_sentence)
39
+ end
40
+
41
+ self
38
42
  end
39
43
 
40
44
  def destroy
41
- self.resource.destroy
45
+ unless resource.destroy
46
+ error(resource.errors.full_messages.to_sentence)
47
+ end
48
+
49
+ self
42
50
  end
43
51
  end
44
52
  end
@@ -54,7 +54,7 @@ module Lesli
54
54
  # Example:
55
55
  # app/views/lesli_support/tickets
56
56
  def views_directory
57
- File.join(ENGINE_ROOT, "app/views", engine_name, resource_collection_name)
57
+ engine_root.join("app/views", engine_name, resource_collection_name)
58
58
  end
59
59
 
60
60
  # Returns only scalar-like attributes that can be rendered
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lesli/resource/resource_generator"
4
+
5
+ # Provides the concise `rails generate lesli RESOURCE` command while the
6
+ # implementation remains available as `lesli:resource`.
7
+ class LesliGenerator < Lesli::Generators::ResourceGenerator
8
+ namespace "lesli"
9
+ source_root Lesli::Generators::ResourceGenerator.source_root
10
+ desc "Generate a complete account-scoped resource inside a Lesli engine"
11
+ end
data/lib/lesli/courier.rb CHANGED
@@ -33,55 +33,87 @@ Building a better future, one line of code at a time.
33
33
  module Lesli
34
34
  class Courier
35
35
 
36
- # Store the module_name (e.g., :lesli_support as LesliSupport)
37
- def initialize(module_name, on_error=nil)
36
+ # Configure the optional engine and its error behavior.
37
+ #
38
+ # module_name: engine module name as a String or Symbol.
39
+ # fallback: value returned when the engine is unavailable or an error is handled.
40
+ # fallback_on_error: return the fallback instead of raising execution errors.
41
+ def initialize(module_name, fallback=nil, fallback_on_error: false)
38
42
  @module_name = module_name.to_s.camelize
39
- @on_error = on_error
43
+ @fallback = fallback
44
+ @fallback_on_error = fallback_on_error
40
45
  end
41
46
 
42
- # Dynamically determine the class to call (e.g., :ticket_service as TicketService)
43
- def from(service_name, *args)
44
- @service_params = args
47
+ # Select the class to instantiate (e.g., :ticket_service as TicketService),
48
+ # store its constructor arguments, and return self to keep the call chainable.
49
+ #
50
+ # service_name: class name as a String or Symbol.
51
+ # *args: positional arguments passed to the class constructor.
52
+ # **kwargs: keyword arguments passed to the class constructor.
53
+ def from(service_name, *args, **kwargs)
54
+ @service_args = args
55
+ @service_kwargs = kwargs
45
56
  @service_name = service_name.to_s.camelize
46
57
  self
47
58
  end
48
59
 
49
- # Store the method name to call on the service (e.g., :index_with_deadline)
50
- def call(method_name, *args)
51
- @method_params = args
60
+ # Select and execute a public method on the configured class instance.
61
+ #
62
+ # method_name: method name as a String or Symbol.
63
+ # *args: positional arguments passed to the method.
64
+ # **kwargs: keyword arguments passed to the method.
65
+ # Returns the value returned by the invoked method.
66
+ def call(method_name, *args, **kwargs)
67
+ @method_args = args
68
+ @method_kwargs = kwargs
52
69
  @method_name = method_name
53
- self.execute
70
+ execute
54
71
  end
55
72
 
56
- private
73
+ private
57
74
 
58
- # Execute the final call to the service, either with or without params
75
+ # The engine is always optional. Errors from an installed engine remain
76
+ # visible unless the caller explicitly enables fallback_on_error.
59
77
  def execute
78
+ # Resolve the configured engine name as a top-level Ruby module.
79
+ engine_module = resolve_constant(Object, @module_name)
80
+
81
+ # Return the configured fallback when the optional engine is not installed.
82
+ return fallback unless engine_module
83
+
84
+ # Resolve the configured class directly inside the engine module.
85
+ service_class = engine_module.const_get(@service_name, false)
86
+
87
+ # Instantiate the class with the arguments previously stored by `from`.
88
+ service = service_class.new(*@service_args, **@service_kwargs)
89
+
90
+ # Invoke the public method configured by `call` and return its result.
91
+ service.public_send(@method_name, *@method_args, **@method_kwargs)
92
+ rescue StandardError => error
93
+ # Re-raise by default so integration and implementation errors remain visible.
94
+ raise unless @fallback_on_error
95
+
96
+ # Record handled errors without interrupting the caller's execution.
97
+ Rails.error.report(
98
+ error,
99
+ handled: true,
100
+ context: {
101
+ module_name: @module_name,
102
+ service_name: @service_name,
103
+ method_name: @method_name
104
+ }
105
+ )
106
+
107
+ # Allow optional integrations to fail without breaking the calling feature.
108
+ fallback
109
+ end
60
110
 
61
- module_name = "#{@module_name}"
62
-
63
- # Look up the module and class dynamically
64
- raise unless Object.const_defined?(module_name)
65
-
66
- module_service_name = "#{@module_name}::#{@service_name}"
67
-
68
- raise unless Object.const_defined?(module_service_name)
69
-
70
- # Create a reference of the module service object
71
- module_service_class = module_service_name.constantize
72
-
73
- # Instantiate the service class with or without arguments
74
- module_service_instance = module_service_class.new(*@service_params.to_a)
75
-
76
- # Check if the method is defined on the service instance
77
- raise unless module_service_instance.respond_to?(@method_name)
111
+ attr_reader :fallback
78
112
 
79
- # Dynamically call the method on the service instance
80
- module_service_instance.send(@method_name, *@method_params)
113
+ def resolve_constant(namespace, constant_name)
114
+ return unless namespace.const_defined?(constant_name, false)
81
115
 
82
- rescue => e
83
- ## pp e add a debug message
84
- return @on_error
116
+ namespace.const_get(constant_name, false)
85
117
  end
86
118
  end
87
119
  end
@@ -0,0 +1,145 @@
1
+ =begin
2
+
3
+ Lesli
4
+
5
+ Copyright (c) 2026, Lesli Technologies, S. A.
6
+
7
+ This program is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 3 of the License, or
10
+ (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see http://www.gnu.org/licenses/.
19
+
20
+ Lesli · Ruby on Rails SaaS Development Framework.
21
+
22
+ Made with ♥ by LesliTech
23
+ Building a better future, one line of code at a time.
24
+
25
+ @contact hello@lesli.tech
26
+ @website https://www.lesli.tech
27
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
+
29
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
+ // ·
31
+ =end
32
+
33
+ module Lesli
34
+ class DatabaseTasks
35
+
36
+ # Rails calls this object when db:prepare creates a new database. Its
37
+ # intentionally empty implementation keeps preparation separate from seeds.
38
+ class SeedlessLoader
39
+ def load_seed
40
+ end
41
+ end
42
+ private_constant :SeedlessLoader
43
+
44
+ def rebuild
45
+ reset_database
46
+ seed_database
47
+ configure_database
48
+ print_status
49
+ end
50
+
51
+ def build
52
+ prepare_database
53
+ seed_database
54
+ configure_database
55
+ print_status
56
+ end
57
+
58
+ def prepare
59
+ prepare_database
60
+ configure_database
61
+ print_status
62
+ end
63
+
64
+ def seed
65
+ seed_database
66
+ configure_database
67
+ print_status
68
+ end
69
+
70
+ private
71
+
72
+ def reset_database
73
+ unless Rails.env.development? || Rails.env.test?
74
+ raise "lesli:db:rebuild can only run in development or test"
75
+ end
76
+
77
+ Termline.m("Rebuild the Lesli database from migrations (development and test only)")
78
+
79
+ Rake::Task["db:migrate:reset"].invoke
80
+ Termline.info("Databases rebuilt from the available migrations")
81
+ end
82
+
83
+ def prepare_database
84
+ Termline.info("Prepare the Lesli database")
85
+
86
+ database_tasks = ActiveRecord::Tasks::DatabaseTasks
87
+ original_seed_loader = database_tasks.seed_loader
88
+
89
+ database_tasks.seed_loader = SeedlessLoader.new
90
+ Rake::Task["db:prepare"].invoke
91
+ ensure
92
+ database_tasks.seed_loader = original_seed_loader if database_tasks
93
+ end
94
+
95
+ def seed_database
96
+ Termline.info("Seed the Lesli database")
97
+
98
+ LesliSystem.engines.each_key do |engine|
99
+ next if engine == "Root"
100
+
101
+ engine.constantize::Engine.load_seed
102
+ end
103
+
104
+ Termline.info("Loading seeds for: Main app")
105
+ Rake::Task["db:seed"].invoke
106
+ Termline.br(2)
107
+ end
108
+
109
+ def configure_database
110
+ Termline.info("Configure the Lesli database")
111
+
112
+ build_resources
113
+ initialize_accounts
114
+ synchronize_privileges
115
+ synchronize_translations
116
+ end
117
+
118
+ def build_resources
119
+ Rake::Task["lesli:resources:build"].invoke
120
+ end
121
+
122
+ def initialize_accounts
123
+ Lesli::Account.find_each do |account|
124
+ operator = Lesli::AccountOperator.new(account: account)
125
+ operator.initialize_roles!
126
+ operator.initialize_engines!
127
+ end
128
+ end
129
+
130
+ def synchronize_privileges
131
+ Rake::Task["lesli_shield:privileges"].invoke if defined?(::LesliShield)
132
+ end
133
+
134
+ def synchronize_translations
135
+ return unless defined?(::LesliBabel)
136
+
137
+ Rake::Task["lesli_babel:scan"].invoke
138
+ Rake::Task["lesli_babel:import"].invoke(true)
139
+ end
140
+
141
+ def print_status
142
+ Rake::Task["lesli:status"].invoke
143
+ end
144
+ end
145
+ end
data/lib/lesli/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Lesli
2
- VERSION = "5.1.13"
3
- BUILD = "1792716699"
2
+ VERSION = "5.1.14"
3
+ BUILD = "1794793515"
4
4
  end
@@ -30,107 +30,30 @@ Building a better future, one line of code at a time.
30
30
  // ·
31
31
  =end
32
32
 
33
- # ·
34
- namespace :lesli do
33
+ # ·
34
+ require "lesli/database_tasks"
35
+
36
+ namespace :lesli do
35
37
  namespace :db do
36
38
 
37
- desc "Drop, create, migrate, seed & configure the Lesli database (development only)"
38
- task :rebuild => :environment do |task, args|
39
- drop()
40
- prepare()
41
- seed()
42
- configure()
43
- status()
39
+ desc "Drop, create, migrate, seed & configure the Lesli database (development and test only)"
40
+ task rebuild: :environment do
41
+ Lesli::DatabaseTasks.new.rebuild
44
42
  end
45
43
 
46
-
47
- desc "Migrate, configure && user the Lesli database"
48
- task :prepare => :environment do |task, args|
49
- prepare()
50
- configure()
51
- status()
44
+ desc "Create, migrate, seed & configure the Lesli database"
45
+ task build: :environment do
46
+ Lesli::DatabaseTasks.new.build
52
47
  end
53
48
 
54
- desc "Seed & configure Lesli database"
55
- task :seed => :environment do |task, args|
56
- seed()
57
- status()
49
+ desc "Migrate and configure the Lesli database"
50
+ task prepare: :environment do
51
+ Lesli::DatabaseTasks.new.prepare
58
52
  end
59
- end
60
-
61
- # Drop the Lesli database (development only)
62
- def drop
63
53
 
64
- # do not execute this task if we are at production level
65
- raise "Cannot drop database in production" if Rails.env.production?
66
-
67
- # print a message to let the users show the action running
68
- Termline.m("Drop the Lesli database (development only)")
69
-
70
- Rake::Task['db:drop'].invoke
71
- Termline.info("Databases deleted")
72
-
73
- schema_file = Rails.root.join('db', 'schema.rb')
74
- if File.exist?(schema_file)
75
- File.delete(schema_file)
76
- Termline.info("Schema.rb file deleted")
54
+ desc "Seed and configure the Lesli database"
55
+ task seed: :environment do
56
+ Lesli::DatabaseTasks.new.seed
77
57
  end
78
58
  end
79
-
80
- # Create the Lesli database (development only)
81
- def prepare
82
-
83
- # print a message to let the users show the action running
84
- Termline.info("Prepare the Lesli database")
85
-
86
- Rake::Task['db:prepare'].invoke
87
- end
88
-
89
- def seed
90
-
91
- # print a message to let the users show the action running
92
- Termline.info("Seed the Lesli database")
93
-
94
- # load Lesli* gems seeders
95
- LesliSystem.engines.each do |engine, data|
96
- next if engine == "Root"
97
- engine.constantize::Engine.load_seed
98
- end
99
-
100
- # load main app seeders
101
- Rake::Task['db:seed'].invoke
102
- Termline.info("Loading seeds for: Main app")
103
- Termline.br(2)
104
- end
105
-
106
- def configure
107
-
108
- # print a message to let the users show the action running
109
- Termline.info("Setup the Lesli database")
110
-
111
- # scan rails routes to build the controllers index
112
- Rake::Task['lesli:resources:build'].invoke
113
-
114
- Lesli::Account.find_each do |account|
115
- account.initialize_account
116
- account.initialize_engines
117
- end
118
-
119
- # scan rails routes to build the controllers index
120
- Rake::Task['lesli_shield:privileges'].invoke if defined?(LesliShield)
121
-
122
- if defined?(LesliBabel)
123
-
124
- # scan rails routes to build the base of translations
125
- Rake::Task['lesli_babel:scan'].invoke
126
-
127
- # import local translations into LesliBabel
128
- Rake::Task['lesli_babel:import'].invoke
129
- end
130
- end
131
-
132
- def status
133
- # print the lesli status
134
- Rake::Task['lesli:status'].invoke
135
- end
136
59
  end
@@ -36,7 +36,7 @@ namespace :lesli do
36
36
 
37
37
  desc "Scan new routes added and create role privileges"
38
38
  task build: :environment do
39
- Lesli::ResourceService.new.build
39
+ Lesli::ResourceOperator.new.register!
40
40
  Termline.success("Lesli: Registering engines, controllers and actions")
41
41
  end
42
42
  end
data/readme.md CHANGED
@@ -113,8 +113,10 @@ bin/rails lesli:db:prepare
113
113
  bin/rails lesli:status
114
114
  ```
115
115
 
116
+ Use `bin/rails lesli:db:build` when the environment also needs the engine and host application seed data. It prepares, seeds, and configures the database without dropping existing data.
117
+
116
118
  > [!WARNING]
117
- > `bin/rails lesli:db:rebuild` drops the database, deletes `db/schema.rb`, prepares and seeds the database, configures Lesli accounts, and prints the system status. It is blocked in production; use it only when you intentionally want to replace the current development data.
119
+ > `bin/rails lesli:db:rebuild` drops the database, rebuilds it from the migrations currently provided by the host and installed engines, regenerates the schema, loads seeds, configures Lesli accounts, and prints the system status. It runs only in the Rails development and test environments; use it only when you intentionally want to replace disposable data.
118
120
 
119
121
  ### Start the server
120
122
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lesli
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.13
4
+ version: 5.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Lesli Development Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-23 00:00:00.000000000 Z
11
+ date: 2026-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -175,6 +175,7 @@ files:
175
175
  - app/controllers/lesli/roles_controller.rb
176
176
  - app/controllers/lesli/shared/dashboards_controller.rb
177
177
  - app/controllers/lesli/users_controller.rb
178
+ - app/helpers/lesli/announcements_helper.rb
178
179
  - app/helpers/lesli/customization_helper.rb
179
180
  - app/helpers/lesli/html_helper.rb
180
181
  - app/helpers/lesli/navigation_helper.rb
@@ -206,6 +207,8 @@ files:
206
207
  - app/models/lesli/shared/catalog.rb
207
208
  - app/models/lesli/shared/dashboard.rb
208
209
  - app/models/lesli/user.rb
210
+ - app/operators/lesli/account_operator.rb
211
+ - app/operators/lesli/resource_operator.rb
209
212
  - app/services/lesli/application_lesli_service.rb
210
213
  - app/services/lesli/resource_service.rb
211
214
  - app/services/lesli/role_service.rb
@@ -220,6 +223,7 @@ files:
220
223
  - app/views/lesli/layouts/mailer.html.erb
221
224
  - app/views/lesli/layouts/mailer.text.erb
222
225
  - app/views/lesli/partials/_application-lesli-analytics.html.erb
226
+ - app/views/lesli/partials/_application-lesli-announcements.html.erb
223
227
  - app/views/lesli/partials/_application-lesli-assets.html.erb
224
228
  - app/views/lesli/partials/_application-lesli-content.html.erb
225
229
  - app/views/lesli/partials/_application-lesli-data.html.erb
@@ -228,7 +232,6 @@ files:
228
232
  - app/views/lesli/partials/_application-lesli-header.html.erb
229
233
  - app/views/lesli/partials/_application-lesli-navigation.html.erb
230
234
  - app/views/lesli/partials/_application-lesli-notifications.html.erb
231
- - app/views/lesli/partials/_application-lesli-sidebar.html.erb
232
235
  - app/views/lesli/partials/_application-lesli-turbo.html.erb
233
236
  - app/views/lesli/partials/turbo/_redirection.html.erb
234
237
  - app/views/lesli/shared/dashboards/edit.html.erb
@@ -255,6 +258,22 @@ files:
255
258
  - lib/generators/lesli/install/templates/lesli.rb
256
259
  - lib/generators/lesli/model/model_generator.rb
257
260
  - lib/generators/lesli/model/templates/model.rb.tt
261
+ - lib/generators/lesli/resource/resource_generator.rb
262
+ - lib/generators/lesli/resource/templates/controller.rb.tt
263
+ - lib/generators/lesli/resource/templates/locale.en.yml.tt
264
+ - lib/generators/lesli/resource/templates/migration.rb.tt
265
+ - lib/generators/lesli/resource/templates/model.rb.tt
266
+ - lib/generators/lesli/resource/templates/operator.rb.tt
267
+ - lib/generators/lesli/resource/templates/service.rb.tt
268
+ - lib/generators/lesli/resource/templates/tests/controller_test.rb.tt
269
+ - lib/generators/lesli/resource/templates/tests/model_test.rb.tt
270
+ - lib/generators/lesli/resource/templates/tests/operator_test.rb.tt
271
+ - lib/generators/lesli/resource/templates/tests/service_test.rb.tt
272
+ - lib/generators/lesli/resource/templates/views/_form.html.erb.tt
273
+ - lib/generators/lesli/resource/templates/views/edit.html.erb.tt
274
+ - lib/generators/lesli/resource/templates/views/index.html.erb.tt
275
+ - lib/generators/lesli/resource/templates/views/new.html.erb.tt
276
+ - lib/generators/lesli/resource/templates/views/show.html.erb.tt
258
277
  - lib/generators/lesli/scaffold/scaffold_generator.rb
259
278
  - lib/generators/lesli/service/service_generator.rb
260
279
  - lib/generators/lesli/service/templates/service.rb.tt
@@ -263,9 +282,11 @@ files:
263
282
  - lib/generators/lesli/views/templates/new.html.erb.tt
264
283
  - lib/generators/lesli/views/templates/show.html.erb.tt
265
284
  - lib/generators/lesli/views/views_generator.rb
285
+ - lib/generators/lesli_generator.rb
266
286
  - lib/lesli.rb
267
287
  - lib/lesli/configuration.rb
268
288
  - lib/lesli/courier.rb
289
+ - lib/lesli/database_tasks.rb
269
290
  - lib/lesli/engine.rb
270
291
  - lib/lesli/router.rb
271
292
  - lib/lesli/version.rb