mirror of
https://github.com/paper-trail-gem/paper_trail.git
synced 2022-11-09 11:33:19 -05:00
Lint: Style/FrozenStringLiteralComment
This commit is contained in:
parent
49397aca6f
commit
cfbf7a647c
166 changed files with 328 additions and 9 deletions
|
@ -12,13 +12,6 @@ Metrics/CyclomaticComplexity:
|
|||
Metrics/PerceivedComplexity:
|
||||
Max: 9 # Goal: 7
|
||||
|
||||
# Switching to frozen strings internally would be fine, but if any of those
|
||||
# frozen strings cross our public API, that would be a breaking change.
|
||||
# Let's wait until we drop support for ruby 2.2 before doing this. If we freeze
|
||||
# before dropping 2.2, the comment could be misleading.
|
||||
Style/FrozenStringLiteralComment:
|
||||
Enabled: false
|
||||
|
||||
RSpec/InstanceVariable:
|
||||
Exclude:
|
||||
- spec/paper_trail/associations_spec.rb
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Specify here only version constraints that differ from
|
||||
# `paper_trail.gemspec`.
|
||||
#
|
||||
|
|
|
@ -9,6 +9,7 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
|
|||
|
||||
- Drop support for ruby 2.2, [whose EoL is the end of March,
|
||||
2018](https://www.ruby-lang.org/en/news/2017/09/14/ruby-2-2-8-released/)
|
||||
- Assume that all strings returned by PaperTrail are frozen.
|
||||
- Removed deprecated `Version#originator`, use `#paper_trail_originator`
|
||||
- Using paper_trail.on_destroy(:after) with ActiveRecord's
|
||||
belongs_to_required_by_default will produce an error instead of a warning.
|
||||
|
|
2
Gemfile
2
Gemfile
|
@ -1,2 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
source "https://rubygems.org"
|
||||
gemspec
|
||||
|
|
2
Rakefile
2
Rakefile
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "bundler"
|
||||
Bundler::GemHelper.install_tasks
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Use this template to report PaperTrail bugs.
|
||||
# Please include only the minimum code necessary to reproduce your issue.
|
||||
require "bundler/inline"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "rails/generators"
|
||||
require "rails/generators/active_record"
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "active_support"
|
||||
require "request_store"
|
||||
require "paper_trail/cleaner"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "paper_trail/type_serializers/postgres_array_serializer"
|
||||
|
||||
module PaperTrail
|
||||
|
@ -7,7 +9,7 @@ module PaperTrail
|
|||
# replaces certain default Active Record serializers
|
||||
# with custom PaperTrail ones.
|
||||
module AttributeSerializerFactory
|
||||
AR_PG_ARRAY_CLASS = "ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array".freeze
|
||||
AR_PG_ARRAY_CLASS = "ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array"
|
||||
|
||||
def self.for(klass, attr)
|
||||
active_record_serializer = klass.type_for_attribute(attr)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "paper_trail/attribute_serializers/attribute_serializer_factory"
|
||||
|
||||
module PaperTrail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "paper_trail/attribute_serializers/cast_attribute_serializer"
|
||||
|
||||
module PaperTrail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "paper_trail/attribute_serializers/cast_attribute_serializer"
|
||||
|
||||
module PaperTrail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
# Utilities for deleting version records.
|
||||
module Cleaner
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "singleton"
|
||||
require "paper_trail/serializers/yaml"
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# This file only needs to be loaded if the gem is being used outside of Rails,
|
||||
# since otherwise the model(s) will get loaded in via the `Rails::Engine`.
|
||||
require "paper_trail/frameworks/active_record/models/paper_trail/version_association"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "paper_trail/version_concern"
|
||||
|
||||
module PaperTrail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "paper_trail/version_association_concern"
|
||||
|
||||
module PaperTrail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# before hook for Cucumber
|
||||
Before do
|
||||
PaperTrail.enabled = false
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "paper_trail/frameworks/rails/controller"
|
||||
require "paper_trail/frameworks/rails/engine"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
module Rails
|
||||
# Extensions to rails controllers. Provides convenient ways to pass certain
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
module Rails
|
||||
# See http://guides.rubyonrails.org/engines.html
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "rspec/core"
|
||||
require "rspec/matchers"
|
||||
require "paper_trail/frameworks/rspec/helpers"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
module RSpec
|
||||
module Helpers
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/core_ext/object" # provides the `try` method
|
||||
require "paper_trail/attribute_serializers/object_attribute"
|
||||
require "paper_trail/attribute_serializers/object_changes_attribute"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/core_ext"
|
||||
|
||||
module PaperTrail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
module Queries
|
||||
module Versions
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
module Queries
|
||||
module Versions
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
# Represents the history of a single record.
|
||||
# @api private
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
# Represents the "paper trail" for a single record.
|
||||
class RecordTrail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "paper_trail/attribute_serializers/object_attribute"
|
||||
require "paper_trail/reifiers/belongs_to"
|
||||
require "paper_trail/reifiers/has_and_belongs_to_many"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
module Reifiers
|
||||
# Reify a single `belongs_to` association of `model`.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
module Reifiers
|
||||
# Reify a single HABTM association of `model`.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
module Reifiers
|
||||
# Reify a single, direct (not `through`) `has_many` association of `model`.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
module Reifiers
|
||||
# Reify a single HMT association of `model`.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
module Reifiers
|
||||
# Reify a single `has_one` association of `model`.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/json"
|
||||
|
||||
module PaperTrail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "yaml"
|
||||
|
||||
module PaperTrail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
module TypeSerializers
|
||||
# Provides an alternative method of serialization
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/concern"
|
||||
|
||||
module PaperTrail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/concern"
|
||||
require "paper_trail/attribute_serializers/object_changes_attribute"
|
||||
require "paper_trail/queries/versions/where_object"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PaperTrail
|
||||
# The version number of the paper_trail gem. Not to be confused with
|
||||
# `PaperTrail::Version`. Ruby constants are case-sensitive, apparently,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
||||
require "paper_trail/version_number"
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "spec_helper"
|
||||
|
||||
RSpec.describe ArticlesController, type: :controller do
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "spec_helper"
|
||||
|
||||
RSpec.describe WidgetsController, type: :controller, versioning: true do
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
||||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
protect_from_forgery
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ArticlesController < ApplicationController
|
||||
def create
|
||||
@article = Article.create article_params
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class TestController < ActionController::Base
|
||||
def user_for_paper_trail
|
||||
Thread.current.object_id
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class WidgetsController < ApplicationController
|
||||
def paper_trail_enabled_for_controller
|
||||
request.user_agent != "Disable User-Agent"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Animal < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
self.inheritance_column = "species"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Demonstrates the `only` and `ignore` attributes, among other things.
|
||||
class Article < ActiveRecord::Base
|
||||
has_paper_trail(
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Authorship < ActiveRecord::Base
|
||||
belongs_to :book
|
||||
belongs_to :author, class_name: "Person"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class BarHabtm < ActiveRecord::Base
|
||||
has_and_belongs_to_many :foo_habtms
|
||||
has_paper_trail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Book < ActiveRecord::Base
|
||||
has_many :authorships, dependent: :destroy
|
||||
has_many :authors, through: :authorships
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Boolit < ActiveRecord::Base
|
||||
default_scope { where(scoped: true) }
|
||||
has_paper_trail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CallbackModifier < ActiveRecord::Base
|
||||
has_paper_trail on: []
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Car < Vehicle
|
||||
has_paper_trail
|
||||
end
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Cat < Animal
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Chapter < ActiveRecord::Base
|
||||
has_many :sections, dependent: :destroy
|
||||
has_many :paragraphs, through: :sections
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Citation < ActiveRecord::Base
|
||||
belongs_to :quotation
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "securerandom"
|
||||
|
||||
class CustomPrimaryKeyRecord < ActiveRecord::Base
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Customer < ActiveRecord::Base
|
||||
has_many :orders, dependent: :destroy
|
||||
has_paper_trail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Demonstrates a "custom versions association name". Instead of the assication
|
||||
# being named `versions`, it will be named `paper_trail_versions`.
|
||||
class Document < ActiveRecord::Base
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Dog < Animal
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# to demonstrate a has_through association that does not have paper_trail enabled
|
||||
class Editor < ActiveRecord::Base
|
||||
has_many :editorships, dependent: :destroy
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Editorship < ActiveRecord::Base
|
||||
belongs_to :book
|
||||
belongs_to :editor
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Elephant < Animal
|
||||
paper_trail.disable
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Family
|
||||
class Family < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Family
|
||||
class FamilyLine < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Fluxor < ActiveRecord::Base
|
||||
if ActiveRecord.gem_version >= Gem::Version.new("5.0")
|
||||
belongs_to :widget, optional: true
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class FooHabtm < ActiveRecord::Base
|
||||
has_and_belongs_to_many :bar_habtms
|
||||
accepts_nested_attributes_for :bar_habtms
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class FooWidget < Widget
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Fruit < ActiveRecord::Base
|
||||
if ENV["DB"] == "postgres" || JsonVersion.table_exists?
|
||||
has_paper_trail class_name: "JsonVersion"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Gadget < ActiveRecord::Base
|
||||
has_paper_trail ignore: :brand
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Kitchen
|
||||
class Banana < ActiveRecord::Base
|
||||
has_paper_trail class_name: "Kitchen::BananaVersion"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# The `legacy_widgets` table has a `version` column that would conflict with our
|
||||
# `version` method. It is configured to define a method named `custom_version`
|
||||
# instead.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class LineItem < ActiveRecord::Base
|
||||
belongs_to :order, dependent: :destroy
|
||||
has_paper_trail
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# This model does not record versions when updated.
|
||||
class NotOnUpdate < ActiveRecord::Base
|
||||
has_paper_trail on: %i[create destroy]
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module On
|
||||
class Create < ActiveRecord::Base
|
||||
self.table_name = :on_create
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module On
|
||||
class Destroy < ActiveRecord::Base
|
||||
self.table_name = :on_destroy
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module On
|
||||
class EmptyArray < ActiveRecord::Base
|
||||
self.table_name = :on_empty_array
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module On
|
||||
class Update < ActiveRecord::Base
|
||||
self.table_name = :on_update
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Order < ActiveRecord::Base
|
||||
belongs_to :customer
|
||||
has_many :line_items
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Paragraph < ActiveRecord::Base
|
||||
belongs_to :section
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Person < ActiveRecord::Base
|
||||
has_many :authorships, foreign_key: :author_id, dependent: :destroy
|
||||
has_many :books, through: :authorships
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Post < ActiveRecord::Base
|
||||
has_paper_trail class_name: "PostVersion"
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# This model tests ActiveRecord::Enum, which was added in AR 4.1
|
||||
# http://edgeguides.rubyonrails.org/4_1_release_notes.html#active-record-enums
|
||||
class PostWithStatus < ActiveRecord::Base
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Quotation < ActiveRecord::Base
|
||||
belongs_to :chapter
|
||||
has_many :citations, dependent: :destroy
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Section < ActiveRecord::Base
|
||||
belongs_to :chapter
|
||||
has_many :paragraphs, dependent: :destroy
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Skipper < ActiveRecord::Base
|
||||
has_paper_trail ignore: [:created_at], skip: [:another_timestamp]
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module OverrideSongAttributesTheRails4Way
|
||||
def attributes
|
||||
if name
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Thing < ActiveRecord::Base
|
||||
has_paper_trail save_changes: false
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Demonstrates the `if` and `unless` configuration options.
|
||||
class Translation < ActiveRecord::Base
|
||||
# Has a `type` column, but it's not used for STI.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Truck < Vehicle
|
||||
# This STI child class specifically does not call `has_paper_trail`.
|
||||
# Of the sub-classes of `Vehicle`, only `Car` is versioned.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PostgresUser < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Vehicle < ActiveRecord::Base
|
||||
# This STI parent class specifically does not call `has_paper_trail`.
|
||||
# Of its sub-classes, only `Car` is versioned.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Whatchamajigger < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Widget < ActiveRecord::Base
|
||||
EXCLUDED_NAME = "Biglet".freeze
|
||||
EXCLUDED_NAME = "Biglet"
|
||||
has_paper_trail
|
||||
has_one :wotsit
|
||||
has_many(:fluxors, -> { order(:name) })
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Wotsit < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CustomPrimaryKeyRecordVersion < PaperTrail::Version
|
||||
self.table_name = "custom_primary_key_record_versions"
|
||||
end
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue