migration_queries 0.4.0 → 1.0.0

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: 4ff997e1ebe254c3fd23a538365fa0cafbcfc010c3e5199054202ed6bd1b2851
4
- data.tar.gz: 70bef9fc0517130bc9158cc1f48c32b38c098ab9f93248de3957da1ea52ae87a
3
+ metadata.gz: d841a636d5ad72e9991f1f87ed98bb4a0a1b51098a674db5dae93f5d2f94ccaa
4
+ data.tar.gz: aa79169e44d9ce5adbbf1142d738d49b3aee19048f86baa82be747695b653c8a
5
5
  SHA512:
6
- metadata.gz: 55526a659e9ea130374069cc062a9895ffe8734845f91490514a64ad24ae11b3b574c7ccdc2011364585a2d63ec4037596a3d31c33e5e6724036714695b59f6a
7
- data.tar.gz: f80f52f70194dd955c697d931ac42cc6c08b85cdd67e2ffb717ec5c1dc1b307e1d5b40f383117774c769a2630aec96777ac6cb75076fdf0db16dec7a8ee244ab
6
+ metadata.gz: 65e15bb1a441237afbc72d50a9206334dd7dafee4e0f4af3cbbbb949106e3e3e57088bada8464b781071177219ca366f1ffb1e34b3ef30675ce8117a09d59a27
7
+ data.tar.gz: b0cecb473508ad96399022335b6ff0e9decc6951f6f7f6b82f6bdd45a7acd70733a16358a8906f4279a93d8697ba8e9240bef4f0e77798a39d8845ac640ff29c
data/README.md CHANGED
@@ -14,12 +14,6 @@ end
14
14
 
15
15
  Then, run `bundle install` to install the gem.
16
16
 
17
- And then execute:
18
-
19
- ```bash
20
- bundle exec rake migration_queries:install
21
- ```
22
-
23
17
  ## Usage
24
18
 
25
19
  The gem is going to automatically track migration queries executed by ActiveRecord. You can view the logged queries in your Rails console or in the log files.
data/Rakefile CHANGED
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- load("lib/tasks/setup_migration_queries.rake")
4
-
5
3
  require "bundler/gem_tasks"
6
4
  require "rspec/core/rake_task"
7
5
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MigrationQueries
4
- VERSION = "0.4.0"
4
+ VERSION = "1.0.0"
5
5
  end
@@ -6,6 +6,9 @@ require_relative "migration_queries/executer"
6
6
  require_relative "migration_queries/migrater"
7
7
  require "active_record"
8
8
 
9
+ ActiveRecord::ConnectionAdapters::AbstractAdapter.include(MigrationQueries::Executer)
10
+ ActiveRecord::Migration::Current.include(MigrationQueries::Migrater)
11
+
9
12
  # MigrationQueries is a module that provides functionality to gather, execute, and migrate SQL queries
10
13
  # during ActiveRecord migrations. It includes the Gatherer, Executer, and Migrater modules to handle
11
14
  # different aspects of SQL query management.
@@ -15,9 +18,4 @@ module MigrationQueries
15
18
  def self.gatherer
16
19
  @gatherer ||= MigrationQueries::Gatherer.new
17
20
  end
18
-
19
- def self.init!
20
- ActiveRecord::ConnectionAdapters::AbstractAdapter.include(MigrationQueries::Executer)
21
- ActiveRecord::Migration::Current.include(MigrationQueries::Migrater)
22
- end
23
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: migration_queries
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Szymon Lipka
@@ -46,7 +46,6 @@ files:
46
46
  - lib/migration_queries/gatherer.rb
47
47
  - lib/migration_queries/migrater.rb
48
48
  - lib/migration_queries/version.rb
49
- - lib/tasks/setup_migration_queries.rake
50
49
  - sig/migration_queries.rbs
51
50
  - sig/migration_queries/data.rbs
52
51
  - sig/migration_queries/executer.rbs
@@ -1,24 +0,0 @@
1
- # lib/tasks/setup_migration_queries.rake
2
-
3
- namespace :migration_queries do
4
- desc "Create migration_queries.rb initializer"
5
- task :setup do
6
- initializer_path = Rails.root.join("config", "initializers", "migration_queries.rb")
7
- content = <<~RUBY
8
- # frozen_string_literal: true
9
-
10
- if Rails.env.development?
11
- require 'migration_queries'
12
-
13
- MigrationQueries.init!
14
- end
15
- RUBY
16
-
17
- if File.exist?(initializer_path)
18
- puts "Initializer file already exists at #{initializer_path}"
19
- else
20
- File.write(initializer_path, content)
21
- puts "Created initializer file at #{initializer_path}"
22
- end
23
- end
24
- end