rails_audit_log 1.4.0 → 1.6.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: 9e3de1e31a64d33c94042ea45ff4eeb391d48cc65db934bf7b7256656326c480
4
- data.tar.gz: e34d558b4687f61336af9a7f7e6ae3faebe6ea77533e7da8e360d27dbfc70060
3
+ metadata.gz: ee40b3b22f2f2a2b0b172ab8790f3f7e7a4317ba62e204149f9c676b51587cff
4
+ data.tar.gz: 4a2ff97b26eba46427a429ad833ef5083d1f733804f002a001df348617d5b51b
5
5
  SHA512:
6
- metadata.gz: cd8d51146c5b915b5c00cc863f23cffc70066cf4cfaafc5e667e9b064b225168b71f45d5699199ba37de78f0089cebabb8a1707f6f837642c32b0fb73c290a6c
7
- data.tar.gz: 3abf1d5c1894de5496a76b8827eb23f6f8b430e9a4a192505e1012a3be022cf01290b5ef38cc3d9b43e2e4dc5f46c2e2667fdd77015ce0dfb111fab6141530b5
6
+ metadata.gz: c175fe09de7e324232d55a083ac11db1dba88818779b18fe139c54d655b89bdf871caebdfc0b8161a9c730f2dc8246d886c7b280523532f300dccaf8d7025825
7
+ data.tar.gz: 36ef89be1868b069c8e3d46fa8d0759b0b2ba4fca231d928523cc9919f9c354637e34dc15dce2c6b2d72191e0d0a2f472c6e520bf7330dea35234c08f9a17ea2
data/README.md CHANGED
@@ -909,20 +909,47 @@ article.paper_trail.version_at(1.week.ago) # reconstructed state at a point in t
909
909
 
910
910
  [↑ Table of contents](#table-of-contents)
911
911
 
912
- > Coming in the 1.x series
912
+ Each companion gem declares `rails_audit_log` as a dependency so you only add what you use.
913
913
 
914
- | Gem | What it adds |
915
- |---|---|
916
- | `rails_audit_log-graphql` | Mountable GraphQL endpoint at `/audit/graphql` — queryable audit trail for API-first apps without forcing `graphql-ruby` on users who don't need it |
914
+ ### `rails_audit_log-graphql`
917
915
 
918
- Each companion gem declares `rails_audit_log` as a dependency so you only add what you use.
916
+ [![Gem Version](https://img.shields.io/gem/v/rails_audit_log-graphql.svg)](https://rubygems.org/gems/rails_audit_log-graphql)
917
+
918
+ A mountable GraphQL endpoint for API-first apps. Shipped as a separate gem so `graphql-ruby` is never a transitive dependency for users who don't need it.
919
+
920
+ Add both gems to your `Gemfile`:
921
+
922
+ ```ruby
923
+ gem "rails_audit_log"
924
+ gem "rails_audit_log-graphql"
925
+ ```
926
+
927
+ Mount the GraphQL engine alongside the main engine:
928
+
929
+ ```ruby
930
+ # config/routes.rb
931
+ mount RailsAuditLog::Engine, at: "/audit"
932
+ mount RailsAuditLog::GraphQL::Engine, at: "/audit/graphql"
933
+ ```
934
+
935
+ Authentication re-uses `RailsAuditLog.authenticate` — nothing extra to configure.
936
+
937
+ **Queries and subscriptions:**
938
+
939
+ | Operation | Signature | Description |
940
+ |---|---|---|
941
+ | `Query.auditLogEntries` | `(event:, itemType:, itemId:, actorId:, since:, until:, page:)` | Filterable, paginated list |
942
+ | `Query.auditLogEntry` | `(id:)` | Single entry lookup with full diff |
943
+ | `Subscription.auditLogEntryCreated` | `(itemType:, itemId:)` | Real-time stream for a resource (requires Action Cable) |
944
+
945
+ All fields on `AuditLogEntry` are exposed via `AuditLogEntryType`.
919
946
 
920
947
  ## Requirements
921
948
 
922
949
  [↑ Table of contents](#table-of-contents)
923
950
 
924
951
  - Ruby >= 3.3
925
- - Rails >= 7.2
952
+ - Rails >= 8.0
926
953
 
927
954
  ## Performance
928
955
 
data/Rakefile CHANGED
@@ -14,7 +14,12 @@ task :zeitwerk do
14
14
  sh({ "RAILS_ENV" => "test" }, "cd spec/dummy && bundle exec rails runner 'Rails.autoloaders.main.eager_load'")
15
15
  end
16
16
 
17
- task default: ["bundle:audit:update", "bundle:audit:check", :rubocop, :zeitwerk, :spec]
17
+ desc "Run Brakeman static analysis on the engine (spec/ and the dummy app are excluded)"
18
+ task :brakeman do
19
+ sh "bundle exec brakeman -q --no-pager --force-scan --skip-files spec/"
20
+ end
21
+
22
+ task default: ["bundle:audit:update", "bundle:audit:check", :brakeman, :rubocop, :zeitwerk, :spec]
18
23
 
19
24
  desc "Run the performance benchmark suite (requires dev:setup first)"
20
25
  task :benchmark do
@@ -142,9 +142,9 @@ module RailsAuditLog
142
142
  # post.audit_log_entries.updated_events.touching(:published_at)
143
143
  scope :touching, ->(attribute) {
144
144
  if connection.adapter_name =~ /PostgreSQL/i
145
- # :nocov:
145
+ # simplecov:disable
146
146
  where("object_changes->>? IS NOT NULL", attribute.to_s)
147
- # :nocov:
147
+ # simplecov:enable
148
148
  else
149
149
  where("json_extract(object_changes, ?) IS NOT NULL", "$.#{attribute}")
150
150
  end
@@ -1,3 +1,3 @@
1
1
  module RailsAuditLog
2
- VERSION = "1.4.0"
2
+ VERSION = "1.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_audit_log
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuck Smith
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '7.2'
18
+ version: '8.0'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '7.2'
25
+ version: '8.0'
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: turbo-rails
28
28
  requirement: !ruby/object:Gem::Requirement