query_lens 0.1.2 → 0.1.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8483ac3f8d86dbaa16242e87fec870d20161b25ccb1e68c6781c77f5043475fb
4
- data.tar.gz: 0f36bbc48b10e5b9fa933d4b57bd05c846947f67dfc906fbc1e06e09e6152c95
3
+ metadata.gz: 302bd0c222f001ae9997180641b03390b244395de3f4b5070b21be1812590fd8
4
+ data.tar.gz: df5c31d6ab1ca79837cb0e433130b0666f45831666b96a704f4ed27ac5b22465
5
5
  SHA512:
6
- metadata.gz: 45eb9530141266e8de24ee0f6fa437e62eb48887f0d9603ad20451046e860f533697ceab831a474200143b1f6ca103b033fbc95080e527e5cb6e9be0cad46ec3
7
- data.tar.gz: 1375571e833d3244d091c4b16b70a363c58289a5b522290679b936bcc376befbbe81363a70092399f56c3e23a8a29befe1755058e63101e0e8f9563fea4ebac5
6
+ metadata.gz: c70804e76cbb049fc5733868e6c0c53976a99960425c1894bd544faeff95e82d93fb6827da4ac3a3355694b478d4b92cb2586e4086f394e402087a6470e5afb1
7
+ data.tar.gz: 60ba99c1ff1753974762f25f2a30def02d1fee229c334d1fcaac773e1dea3978f26a9faf9d0f2d8e2d1e2d4148caa94ae1773eda1f8a34f43b7a7f5b59521f42
data/README.md CHANGED
@@ -43,8 +43,10 @@ rails db:migrate
43
43
 
44
44
  This will:
45
45
  1. Create `config/initializers/query_lens.rb` with RubyLLM and QueryLens configuration
46
- 2. Add the engine route to your `config/routes.rb`
47
- 3. Create the `query_lens_projects`, `query_lens_saved_queries`, and `query_lens_conversations` tables
46
+ 2. Copy the migration to create the `query_lens_projects`, `query_lens_saved_queries`, and `query_lens_conversations` tables
47
+ 3. Add the engine route to your `config/routes.rb`
48
+
49
+ > **Upgrading from a previous version?** If you already ran migrations from an earlier release (before the install generator included them), your tables are already in place. Just run `rails generate query_lens:install` and skip or discard the generated migration file — no need to migrate again.
48
50
 
49
51
  ## Configuration
50
52
 
@@ -1,14 +1,21 @@
1
+ require "rails/generators/active_record/migration"
2
+
1
3
  module QueryLens
2
4
  module Generators
3
5
  class InstallGenerator < Rails::Generators::Base
6
+ include ActiveRecord::Generators::Migration
4
7
  source_root File.expand_path("templates", __dir__)
5
8
 
6
- desc "Creates a QueryLens initializer and adds the engine route."
9
+ desc "Creates a QueryLens initializer, copies migrations, and adds the engine route."
7
10
 
8
11
  def copy_initializer
9
12
  template "initializer.rb", "config/initializers/query_lens.rb"
10
13
  end
11
14
 
15
+ def copy_migrations
16
+ migration_template "create_query_lens_tables.rb.tt", "db/migrate/create_query_lens_tables.rb"
17
+ end
18
+
12
19
  def add_route
13
20
  route 'mount QueryLens::Engine => "/query_lens"'
14
21
  end
@@ -1,4 +1,4 @@
1
- class CreateQueryLensTables < ActiveRecord::Migration[7.1]
1
+ class CreateQueryLensTables < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
2
2
  def change
3
3
  create_table :query_lens_projects do |t|
4
4
  t.string :name, null: false
@@ -5,13 +5,5 @@ module QueryLens
5
5
  initializer "query_lens.assets" do |app|
6
6
  app.config.assets.precompile += %w[query_lens/application.js] if app.config.respond_to?(:assets)
7
7
  end
8
-
9
- initializer "query_lens.migrations" do |app|
10
- unless app.root.to_s == root.to_s
11
- config.paths["db/migrate"].expanded.each do |expanded_path|
12
- app.config.paths["db/migrate"] << expanded_path
13
- end
14
- end
15
- end
16
8
  end
17
9
  end
@@ -1,3 +1,3 @@
1
1
  module QueryLens
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_lens
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Beshore
@@ -107,8 +107,8 @@ files:
107
107
  - app/views/query_lens/layouts/application.html.erb
108
108
  - app/views/query_lens/queries/show.html.erb
109
109
  - config/routes.rb
110
- - db/migrate/20260207000001_create_query_lens_tables.rb
111
110
  - lib/generators/query_lens/install/install_generator.rb
111
+ - lib/generators/query_lens/install/templates/create_query_lens_tables.rb.tt
112
112
  - lib/generators/query_lens/install/templates/initializer.rb
113
113
  - lib/query_lens.rb
114
114
  - lib/query_lens/configuration.rb