paper_trail-active_record 0.1.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28bf423183511f3a2c63c11421acfec27790f6a99985db9cf25898ab06e54f00
4
- data.tar.gz: 6e470451542d115789496c6c91e8af14245d596fda5afba1ca0a6434c64e3b39
3
+ metadata.gz: 934cfc40b232a8284fdd96e5b6ee941bbcbf743cad7efc46615f1b41e1de7ec4
4
+ data.tar.gz: 2a9ce631a65f989b558343f340b9fd56b1aed9d9cc421b3f10e2593d52de3d74
5
5
  SHA512:
6
- metadata.gz: e8f66e1ca525037858352c503a30793cada982d88c2c103132f99e8b087cfa971b330f42ff2e26b54dd7fda3472aa68d49a89f9a4c9ee64118d87e5a887347fd
7
- data.tar.gz: 47c68747e77bacdd68210e07e13f458631a7e15d532e79439fc9a14e891a93bf6874889647e0ee9aaef72f58d7be7f3c992a355be54bf0887d7576c006166669
6
+ metadata.gz: cce01fc8714b7573a877c02f0c190559b466ce13c35168a9e77ed85d8286f412afb850a3fc1b70283e98295334fb6e2beffb2f4eba1b8d80dfd696bf94ff3898
7
+ data.tar.gz: 16d19245089055b4697aa1de1046d64de445d555e1490e1468cd5a5d3a9ac03cf667989edf40863d0ecf8a5aa168f0b8c3162709d11f3954970627452aeed8b4
data/Changelog.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 1.0.0 (2022-04-27)
2
+
3
+ Breaking changes:
4
+ - `PaperTrail::ActiveRecord` was renamed to `PaperTrail::ActiveRecordExt` to fix this error with paper_trail 12.3.0 / rails 7:
5
+
6
+ NameError:
7
+ uninitialized constant PaperTrail::ActiveRecord::Type
8
+
9
+ elsif PaperTrail::RAILS_GTE_7_0 && val.is_a?(ActiveRecord::Type::Time::Value)
10
+
1
11
  ## 0.1.2 (2020-04-27)
2
12
 
3
13
  - Fix: Remove debug output
data/Readme.md CHANGED
@@ -1,4 +1,4 @@
1
- # PaperTrail::ActiveRecord
1
+ # PaperTrail::ActiveRecordExt
2
2
 
3
3
  [![Gem Version][1]][2]
4
4
  [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](https://rdoc.info/github/TylerRick/paper_trail-active_record/master)
@@ -50,7 +50,7 @@ class Post
50
50
 
51
51
  ### Automatically add for all assocations
52
52
 
53
- If you include `PaperTrail::ActiveRecord::OrDeleted` into a model, it will automatically add a `{association}_or_deleted`
53
+ If you include `PaperTrail::ActiveRecordExt::OrDeleted` into a model, it will automatically add a `{association}_or_deleted`
54
54
  method for every `belongs_to` or `has_one` association that is defined.
55
55
 
56
56
  Because it reflects on all associations on that model as soon as it is included, make sure to
@@ -63,7 +63,7 @@ use [gem 'active_record_include'](https://github.com/TylerRick/active_record_inc
63
63
 
64
64
  ```ruby
65
65
  class ApplicationRecord < ActiveRecord::Base
66
- include_when_connected PaperTrail::ActiveRecord::OrDeleted
66
+ include_when_connected PaperTrail::ActiveRecordExt::OrDeleted
67
67
  ```
68
68
 
69
69
 
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "paper_trail/rails"
4
+ require "paper_trail/active_record"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -1,4 +1,4 @@
1
- module PaperTrail::ActiveRecord
1
+ module PaperTrail::ActiveRecordExt
2
2
 
3
3
  # Extensions to ActiveRecord::Base to better support PaperTrail
4
4
  module BaseExtensions
@@ -13,7 +13,7 @@ module BaseExtensions
13
13
  else
14
14
  Version.where(item_type: base_class.name, item_subtype: self.name)
15
15
  end.tap do |versions|
16
- PaperTrail::ActiveRecord.config.versions_extends.each do |mod|
16
+ PaperTrail::ActiveRecordExt.config.versions_extends.each do |mod|
17
17
  versions.extend(mod)
18
18
  end
19
19
  end
@@ -51,7 +51,7 @@ module BaseExtensions
51
51
  end
52
52
 
53
53
  def has_many_versions(name, *args, **options)
54
- has_many name, *args, class_name: 'Version', extend: PaperTrail::ActiveRecord.config.versions_extends, **options
54
+ has_many name, *args, class_name: 'Version', extend: PaperTrail::ActiveRecordExt.config.versions_extends, **options
55
55
  end
56
56
 
57
57
  # Creates associations for finding related versions — that is, versions for related/children
@@ -123,6 +123,6 @@ end
123
123
  end
124
124
 
125
125
  ActiveRecord::Base.class_eval do
126
- include PaperTrail::ActiveRecord::BaseExtensions
126
+ include PaperTrail::ActiveRecordExt::BaseExtensions
127
127
  end
128
128
 
@@ -1,5 +1,5 @@
1
1
  module PaperTrail
2
- module ActiveRecord
2
+ module ActiveRecordExt
3
3
  class Configuration
4
4
  def initialize
5
5
  config = self
@@ -1,4 +1,4 @@
1
- module PaperTrail::ActiveRecord
1
+ module PaperTrail::ActiveRecordExt
2
2
 
3
3
  # If you include this module into a model, it will automatically add a `{association}_or_deleted`
4
4
  # method for every `belongs_to` or `has_one` association that is defined.
@@ -1,7 +1,7 @@
1
1
  module PaperTrail
2
- module ActiveRecord
2
+ module ActiveRecordExt
3
3
  def self.version
4
- "0.1.2"
4
+ "1.0.0"
5
5
  end
6
6
  end
7
7
  end
@@ -1,4 +1,6 @@
1
- module PaperTrail::ActiveRecord
1
+ require 'paper_trail/version_concern'
2
+
3
+ module PaperTrail::ActiveRecordExt
2
4
  module VersionConcernExt
3
5
  extend ActiveSupport::Concern
4
6
 
@@ -70,7 +72,7 @@ end
70
72
  end
71
73
 
72
74
  PaperTrail::VersionConcern.class_eval do
73
- prepend PaperTrail::ActiveRecord::VersionConcernExt
74
- include PaperTrail::ActiveRecord::VersionConcernExt
75
+ prepend PaperTrail::ActiveRecordExt::VersionConcernExt
76
+ include PaperTrail::ActiveRecordExt::VersionConcernExt
75
77
  end
76
78
 
@@ -1,4 +1,6 @@
1
+ require 'active_record'
1
2
  require 'paper_trail'
3
+ require 'paper_trail/frameworks/active_record'
2
4
 
3
5
  require_relative 'active_record/version'
4
6
 
@@ -8,7 +10,7 @@ require_relative 'active_record/or_deleted'
8
10
  require_relative 'active_record/version_extensions'
9
11
 
10
12
  module PaperTrail
11
- module ActiveRecord
13
+ module ActiveRecordExt
12
14
  class << self
13
15
  def configuration
14
16
  @configuration ||= Configuration.new
@@ -5,7 +5,7 @@ require "paper_trail/active_record/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "paper_trail-active_record"
8
- spec.version = PaperTrail::ActiveRecord.version
8
+ spec.version = PaperTrail::ActiveRecordExt.version
9
9
  spec.authors = ["Tyler Rick"]
10
10
  spec.email = ["tyler@tylerrick.com"]
11
11
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paper_trail-active_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Rick
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-27 00:00:00.000000000 Z
11
+ date: 2022-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paper_trail
@@ -183,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  - !ruby/object:Gem::Version
184
184
  version: '0'
185
185
  requirements: []
186
- rubygems_version: 3.0.3
186
+ rubygems_version: 3.3.3
187
187
  signing_key:
188
188
  specification_version: 4
189
189
  summary: Various ActiveRecord extensions to make your life easier when working with