repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
avmnu-sng/rspec-tracer
https://github.com/avmnu-sng/rspec-tracer/blob/568c5e763385187d50b16ff1a95a859f9f288d20/lib/rspec_tracer/cache.rb
lib/rspec_tracer/cache.rb
# frozen_string_literal: true module RSpecTracer class Cache attr_reader :all_examples, :duplicate_examples, :interrupted_examples, :flaky_examples, :failed_examples, :pending_examples, :skipped_examples, :all_files, :dependency, :examples_coverage, :run_id def initialize ...
ruby
MIT
568c5e763385187d50b16ff1a95a859f9f288d20
2026-01-04T17:33:26.748049Z
false
avmnu-sng/rspec-tracer
https://github.com/avmnu-sng/rspec-tracer/blob/568c5e763385187d50b16ff1a95a859f9f288d20/lib/rspec_tracer/html_reporter/reporter.rb
lib/rspec_tracer/html_reporter/reporter.rb
# frozen_string_literal: true require 'erb' require 'time' module RSpecTracer module HTMLReporter class Reporter attr_reader :last_run, :examples, :flaky_examples, :examples_dependency, :files_dependency def initialize(report_dir, reporter) @report_dir = report_dir @reporter = repor...
ruby
MIT
568c5e763385187d50b16ff1a95a859f9f288d20
2026-01-04T17:33:26.748049Z
false
avmnu-sng/rspec-tracer
https://github.com/avmnu-sng/rspec-tracer/blob/568c5e763385187d50b16ff1a95a859f9f288d20/lib/rspec_tracer/remote_cache/aws.rb
lib/rspec_tracer/remote_cache/aws.rb
# frozen_string_literal: true module RSpecTracer module RemoteCache class Aws class AwsError < StandardError; end def initialize @s3_bucket, @s3_path = setup_s3 @aws_cli = RSpecTracer.use_local_aws ? 'awslocal' : 'aws' end def branch_refs?(branch_name) key = "#{@...
ruby
MIT
568c5e763385187d50b16ff1a95a859f9f288d20
2026-01-04T17:33:26.748049Z
false
avmnu-sng/rspec-tracer
https://github.com/avmnu-sng/rspec-tracer/blob/568c5e763385187d50b16ff1a95a859f9f288d20/lib/rspec_tracer/remote_cache/validator.rb
lib/rspec_tracer/remote_cache/validator.rb
# frozen_string_literal: true module RSpecTracer module RemoteCache class Validator CACHE_FILES_PER_TEST_SUITE = 11 def initialize @test_suite_id = ENV['TEST_SUITE_ID'] @test_suites = ENV['TEST_SUITES'] if @test_suite_id.nil? ^ @test_suites.nil? raise( ...
ruby
MIT
568c5e763385187d50b16ff1a95a859f9f288d20
2026-01-04T17:33:26.748049Z
false
avmnu-sng/rspec-tracer
https://github.com/avmnu-sng/rspec-tracer/blob/568c5e763385187d50b16ff1a95a859f9f288d20/lib/rspec_tracer/remote_cache/repo.rb
lib/rspec_tracer/remote_cache/repo.rb
# frozen_string_literal: true module RSpecTracer module RemoteCache class Repo class RepoError < StandardError; end attr_reader :default_branch_name, :branch_name, :branch_ref, :branch_refs, :ancestry_refs, :cache_refs def initialize(aws) raise RepoError, 'GIT_DEFAULT_BRANCH environme...
ruby
MIT
568c5e763385187d50b16ff1a95a859f9f288d20
2026-01-04T17:33:26.748049Z
false
avmnu-sng/rspec-tracer
https://github.com/avmnu-sng/rspec-tracer/blob/568c5e763385187d50b16ff1a95a859f9f288d20/lib/rspec_tracer/remote_cache/cache.rb
lib/rspec_tracer/remote_cache/cache.rb
# frozen_string_literal: true require_relative 'aws' require_relative 'repo' require_relative 'validator' module RSpecTracer module RemoteCache class Cache class CacheError < StandardError; end def initialize @aws = RSpecTracer::RemoteCache::Aws.new @repo = RSpecTracer::RemoteCache:...
ruby
MIT
568c5e763385187d50b16ff1a95a859f9f288d20
2026-01-04T17:33:26.748049Z
false
akitaonrails/chainable_methods
https://github.com/akitaonrails/chainable_methods/blob/74eec303466219bdffda5e04eb4d09e8c11de052/test/test_helper.rb
test/test_helper.rb
require "codeclimate-test-reporter" CodeClimate::TestReporter.start $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'chainable_methods' require 'minitest/spec' require 'minitest/autorun' require 'pry' require 'vcr' VCR.configure do |config| config.cassette_library_dir = "fixtures/vcr_cassettes"...
ruby
MIT
74eec303466219bdffda5e04eb4d09e8c11de052
2026-01-04T17:34:03.019717Z
false
akitaonrails/chainable_methods
https://github.com/akitaonrails/chainable_methods/blob/74eec303466219bdffda5e04eb4d09e8c11de052/test/chainable_methods_test.rb
test/chainable_methods_test.rb
require 'test_helper' require "uri" require "open-uri" require "nokogiri" include Nokogiri # a module has no state, in this case all methods are 'static' module FooModule include ChainableMethods def do_upcase(state) state.upcase end def append_message(state, message) [state, message].join(" ") end...
ruby
MIT
74eec303466219bdffda5e04eb4d09e8c11de052
2026-01-04T17:34:03.019717Z
false
akitaonrails/chainable_methods
https://github.com/akitaonrails/chainable_methods/blob/74eec303466219bdffda5e04eb4d09e8c11de052/lib/chainable_methods.rb
lib/chainable_methods.rb
require "chainable_methods/version" # easier shortcut def CM(initial_state, context = ChainableMethods::Nil) ChainableMethods::Link.new(initial_state, context) end module ChainableMethods # TODO placeholder context to always delegate method missing to the state object module Nil; end def self.included(base) ...
ruby
MIT
74eec303466219bdffda5e04eb4d09e8c11de052
2026-01-04T17:34:03.019717Z
false
akitaonrails/chainable_methods
https://github.com/akitaonrails/chainable_methods/blob/74eec303466219bdffda5e04eb4d09e8c11de052/lib/chainable_methods/version.rb
lib/chainable_methods/version.rb
module ChainableMethods VERSION = "0.2.1" end
ruby
MIT
74eec303466219bdffda5e04eb4d09e8c11de052
2026-01-04T17:34:03.019717Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail_association_tracking_spec.rb
spec/paper_trail_association_tracking_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe PaperTrailAssociationTracking do describe ".gem_version" do it "returns a Gem::Version" do v = described_class.gem_version expect(v).to be_a(::Gem::Version) expect(v.to_s).to eq(described_class::VERSION) end end end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail_spec.rb
spec/paper_trail_spec.rb
# frozen_string_literal: true require "spec_helper" require "paper_trail/frameworks/rspec" RSpec.describe PaperTrail do context "default" do it "has versioning off by default" do expect(described_class).not_to be_enabled end it "has versioning on in a `with_versioning` block" do expect(desc...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/spec_helper.rb
spec/spec_helper.rb
# frozen_string_literal: true ENV["RAILS_ENV"] = "test" require File.expand_path("../dummy_app/config/environment", __FILE__) RSpec.configure do |config| config.example_status_persistence_file_path = ".rspec_results" config.expect_with :rspec do |expectations| expectations.include_chain_clauses_in_custom_ma...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/controllers/widgets_controller.rb
spec/dummy_app/app/controllers/widgets_controller.rb
# frozen_string_literal: true class WidgetsController < ApplicationController def create @widget = Widget.create widget_params head :ok end def update @widget = Widget.find params[:id] @widget.update widget_params head :ok end def destroy @widget = Widget.find params[:id] @widge...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/controllers/application_controller.rb
spec/dummy_app/app/controllers/application_controller.rb
# frozen_string_literal: true class ApplicationController < ActionController::Base protect_from_forgery # Some applications and libraries modify `current_user`. Their changes need # to be reflected in `whodunnit`, so the `set_paper_trail_whodunnit` below # must happen after this. before_action :modify_curre...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/vehicle.rb
spec/dummy_app/app/models/vehicle.rb
# 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` and `Bicycle` are versioned. belongs_to :owner, class_name: "Person", optional: true end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/book.rb
spec/dummy_app/app/models/book.rb
# frozen_string_literal: true class Book < ActiveRecord::Base has_many :authorships, dependent: :destroy has_many :authors, through: :authorships has_many :editorships, dependent: :destroy has_many :editors, through: :editorships has_many :notes, as: :object has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/quotation.rb
spec/dummy_app/app/models/quotation.rb
# frozen_string_literal: true class Quotation < ActiveRecord::Base belongs_to :chapter has_many :citations, dependent: :destroy has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/chapter.rb
spec/dummy_app/app/models/chapter.rb
# frozen_string_literal: true class Chapter < ActiveRecord::Base has_many :sections, dependent: :destroy has_many :paragraphs, through: :sections has_many :quotations, dependent: :destroy has_many :citations, through: :quotations has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/order.rb
spec/dummy_app/app/models/order.rb
# frozen_string_literal: true class Order < ActiveRecord::Base belongs_to :customer has_many :line_items has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/hunt.rb
spec/dummy_app/app/models/hunt.rb
# frozen_string_literal: true class Hunt < ActiveRecord::Base belongs_to :predator, class_name: "Animal" belongs_to :prey, class_name: "Animal" has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/customer.rb
spec/dummy_app/app/models/customer.rb
# frozen_string_literal: true class Customer < ActiveRecord::Base has_many :orders, dependent: :destroy has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/elephant.rb
spec/dummy_app/app/models/elephant.rb
# frozen_string_literal: true class Elephant < Animal end # Nice! We used to have `paper_trail.disable` inside the class, which was really # misleading because it looked like a permanent, global setting. It's so much # more obvious now that we are disabling the model for this request only. Of # course, we run the PT ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/bicycle.rb
spec/dummy_app/app/models/bicycle.rb
# frozen_string_literal: true class Bicycle < Vehicle has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/custom_version.rb
spec/dummy_app/app/models/custom_version.rb
# frozen_string_literal: true class CustomVersion < PaperTrail::Version has_many :version_associations, class_name: "CustomVersionAssociation", foreign_key: :version_id, dependent: :destroy end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/section.rb
spec/dummy_app/app/models/section.rb
# frozen_string_literal: true class Section < ActiveRecord::Base belongs_to :chapter has_many :paragraphs, dependent: :destroy has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/editorship.rb
spec/dummy_app/app/models/editorship.rb
# frozen_string_literal: true class Editorship < ActiveRecord::Base belongs_to :book belongs_to :editor has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/pet.rb
spec/dummy_app/app/models/pet.rb
# frozen_string_literal: true class Pet < ActiveRecord::Base belongs_to :owner, class_name: "Person", optional: true belongs_to :animal, optional: true has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/citation.rb
spec/dummy_app/app/models/citation.rb
# frozen_string_literal: true class Citation < ActiveRecord::Base belongs_to :quotation has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/bizzo.rb
spec/dummy_app/app/models/bizzo.rb
# frozen_string_literal: true class Bizzo < ActiveRecord::Base has_paper_trail belongs_to :widget has_many :notes, as: :object, dependent: :destroy end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/animal.rb
spec/dummy_app/app/models/animal.rb
# frozen_string_literal: true class Animal < ActiveRecord::Base has_paper_trail self.inheritance_column = "species" has_many :prey, foreign_key: :predator_id, class_name: "Hunt" end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/line_item.rb
spec/dummy_app/app/models/line_item.rb
# frozen_string_literal: true class LineItem < ActiveRecord::Base belongs_to :order, dependent: :destroy has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/note.rb
spec/dummy_app/app/models/note.rb
class Note < ActiveRecord::Base belongs_to :object, polymorphic: true has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/wotsit.rb
spec/dummy_app/app/models/wotsit.rb
# frozen_string_literal: true class Wotsit < ActiveRecord::Base has_paper_trail versions: { class_name: "CustomVersion" }, version_associations: { class_name: "CustomVersionAssociation" } belongs_to :widget, optional: true def created_on created_at.to_date end end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/custom_version_association.rb
spec/dummy_app/app/models/custom_version_association.rb
# frozen_string_literal: true class CustomVersionAssociation < PaperTrail::VersionAssociation belongs_to :version, class_name: "CustomVersion", foreign_key: :version_id, optional: true end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/thing.rb
spec/dummy_app/app/models/thing.rb
# frozen_string_literal: true class Thing < ActiveRecord::Base has_paper_trail save_changes: false belongs_to :person, optional: true end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/car.rb
spec/dummy_app/app/models/car.rb
# frozen_string_literal: true class Car < Vehicle has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/dog.rb
spec/dummy_app/app/models/dog.rb
# frozen_string_literal: true class Dog < Animal end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/editor.rb
spec/dummy_app/app/models/editor.rb
# 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 end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/widget.rb
spec/dummy_app/app/models/widget.rb
# frozen_string_literal: true class Widget < ActiveRecord::Base EXCLUDED_NAME = "Biglet" has_paper_trail has_one :wotsit has_one :bizzo, dependent: :destroy has_many(:fluxors, -> { order(:name) }) has_many :whatchamajiggers, as: :owner has_many :notes, through: :bizzo validates :name, exclusion: { in: ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/fluxor.rb
spec/dummy_app/app/models/fluxor.rb
# frozen_string_literal: true class Fluxor < ActiveRecord::Base belongs_to :widget, optional: true end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/paragraph.rb
spec/dummy_app/app/models/paragraph.rb
# frozen_string_literal: true class Paragraph < ActiveRecord::Base belongs_to :section has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/whatchamajigger.rb
spec/dummy_app/app/models/whatchamajigger.rb
# frozen_string_literal: true class Whatchamajigger < ActiveRecord::Base has_paper_trail belongs_to :owner, polymorphic: true, optional: true end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/person.rb
spec/dummy_app/app/models/person.rb
# frozen_string_literal: true class Person < ActiveRecord::Base has_many :authorships, foreign_key: :author_id, dependent: :destroy has_many :books, through: :authorships has_many :pets, foreign_key: :owner_id, dependent: :destroy has_many :animals, through: :pets has_many :dogs, class_name: "Dog", through:...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/foo_habtm.rb
spec/dummy_app/app/models/foo_habtm.rb
# frozen_string_literal: true class FooHabtm < ActiveRecord::Base has_and_belongs_to_many :bar_habtms accepts_nested_attributes_for :bar_habtms has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/document.rb
spec/dummy_app/app/models/document.rb
# 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 has_paper_trail( versions: {name: :paper_trail_versions}, on: %i[create update] ) end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/authorship.rb
spec/dummy_app/app/models/authorship.rb
# frozen_string_literal: true class Authorship < ActiveRecord::Base belongs_to :book belongs_to :author, class_name: "Person" has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/bar_habtm.rb
spec/dummy_app/app/models/bar_habtm.rb
# frozen_string_literal: true class BarHabtm < ActiveRecord::Base has_and_belongs_to_many :foo_habtms has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/cat.rb
spec/dummy_app/app/models/cat.rb
# frozen_string_literal: true class Cat < Animal end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/user.rb
spec/dummy_app/app/models/user.rb
# frozen_string_literal: true class User < ActiveRecord::Base has_paper_trail end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/family/family_line.rb
spec/dummy_app/app/models/family/family_line.rb
# frozen_string_literal: true module Family class FamilyLine < ActiveRecord::Base has_paper_trail belongs_to :parent, class_name: "::Family::Family", foreign_key: :parent_id, optional: true belongs_to :grandson, class_name: "::Family::Family", foreign_key: :grandson_id, optional: true end end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/app/models/family/family.rb
spec/dummy_app/app/models/family/family.rb
# frozen_string_literal: true module Family class Family < ActiveRecord::Base has_paper_trail has_many :familie_lines, class_name: "::Family::FamilyLine", foreign_key: :parent_id has_many :children, class_name: "::Family::Family", foreign_key: :parent_id has_many :grandsons, through: :familie_lines ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/db/schema.rb
spec/dummy_app/db/schema.rb
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # dat...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/db/migrate/20110208155312_set_up_test_tables.rb
spec/dummy_app/db/migrate/20110208155312_set_up_test_tables.rb
# frozen_string_literal: true # Parts of this migration must be kept in sync with # `lib/generators/paper_trail/templates/create_versions.rb` # # Starting with AR 5.1, we must specify which version of AR we are using. # I tried using `const_get` but I got a `NameError`, then I learned about # `::ActiveRecord::Migratio...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/config/application.rb
spec/dummy_app/config/application.rb
# frozen_string_literal: true require File.expand_path("../boot", __FILE__) require "logger" # Fix for Rails 7.0 and below, https://github.com/rails/rails/pull/54264 # Pick the frameworks you want: require "active_record/railtie" require "action_controller/railtie" Bundler.require(:default, Rails.env) require "pape...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/config/environment.rb
spec/dummy_app/config/environment.rb
# frozen_string_literal: true # Load the rails application require File.expand_path("../application", __FILE__) # Initialize the rails application Dummy::Application.initialize!
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/config/routes.rb
spec/dummy_app/config/routes.rb
# frozen_string_literal: true Dummy::Application.routes.draw do resources :articles, only: [:create] resources :widgets, only: %i[create update destroy] end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/config/boot.rb
spec/dummy_app/config/boot.rb
# Unlike a conventional Rails app, our "dummy" app is booted by our spec_helper.
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/config/initializers/session_store.rb
spec/dummy_app/config/initializers/session_store.rb
# frozen_string_literal: true # Be sure to restart your server when you modify this file. Dummy::Application.config.session_store :cookie_store, key: "_dummy_session" # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/config/initializers/paper_trail.rb
spec/dummy_app/config/initializers/paper_trail.rb
# frozen_string_literal: true PaperTrail.config.track_associations = true
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/config/initializers/inflections.rb
spec/dummy_app/config/initializers/inflections.rb
# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format # (all these examples are active by default): # ActiveSupport::Inflector.inflections do |inflect| # inflect.plural /^(ox)$/i, '\1en' # inflect.singular /^(ox)en/i, '\1' # ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/config/initializers/backtrace_silencers.rb
spec/dummy_app/config/initializers/backtrace_silencers.rb
# frozen_string_literal: true # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish # to see in your backtraces. # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } # You can also remove all the silencers i...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/config/initializers/mime_types.rb
spec/dummy_app/config/initializers/mime_types.rb
# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf # Mime::Type.register_alias "text/html", :iphone
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/dummy_app/config/environments/test.rb
spec/dummy_app/config/environments/test.rb
# frozen_string_literal: true Dummy::Application.configure do # Settings specified here will take precedence over those in config/application.rb # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "s...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail/version_spec.rb
spec/paper_trail/version_spec.rb
# frozen_string_literal: true require "spec_helper" module PaperTrail ::RSpec.describe(Version, versioning: true) do end end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail/model_config_spec.rb
spec/paper_trail/model_config_spec.rb
# frozen_string_literal: true require "spec_helper" module PaperTrail ::RSpec.describe ModelConfig, versioning: true do after do Timecop.return end describe "class_name" do before do @widget = Widget.create(name: "widget_0") @wotsit = Wotsit.create(widget_id: @widget.id, nam...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail/request_spec.rb
spec/paper_trail/request_spec.rb
# frozen_string_literal: true require "spec_helper" module PaperTrail ::RSpec.describe(Request, versioning: true) do end end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail/model_spec.rb
spec/paper_trail/model_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe(::PaperTrail, versioning: true) do context "a new record" do it "not have any previous versions" do expect(Widget.new.versions).to(eq([])) end it "be live" do expect(Widget.new.paper_trail.live?).to(eq(true)) end end ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail/version_concern_spec.rb
spec/paper_trail/version_concern_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe PaperTrail::VersionConcern do end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail/config_spec.rb
spec/paper_trail/config_spec.rb
# frozen_string_literal: true require "spec_helper" module PaperTrail ::RSpec.describe Config do describe "track_associations?" do context "@track_associations is nil" do it "returns false and prints a deprecation warning" do config = described_class.instance config.track_assoc...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail/association_reify_error_behaviour/ignore.rb
spec/paper_trail/association_reify_error_behaviour/ignore.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe PaperTrail, versioning: true do it "baseline test setup" do expect(Person.new).to be_versioned end # See https://github.com/paper-trail-gem/paper_trail/issues/594 describe "#association reify error behaviour" do it "association reify ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail/association_reify_error_behaviour/error.rb
spec/paper_trail/association_reify_error_behaviour/error.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe PaperTrail, versioning: true do it "baseline test setup" do expect(Person.new).to be_versioned end # See https://github.com/paper-trail-gem/paper_trail/issues/594 describe "#association reify error behaviour" do it "association reify ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail/association_reify_error_behaviour/warn.rb
spec/paper_trail/association_reify_error_behaviour/warn.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe PaperTrail, versioning: true do it "baseline test setup" do expect(Person.new).to be_versioned end # See https://github.com/paper-trail-gem/paper_trail/issues/594 describe "#association reify error behaviour" do it "association reify ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail/associations/has_many_through_spec.rb
spec/paper_trail/associations/has_many_through_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe(::PaperTrail, versioning: true) do CHAPTER_NAMES = [ "Down the Rabbit-Hole", "The Pool of Tears", "A Caucus-Race and a Long Tale", "The Rabbit Sends in a Little Bill", "Advice from a Caterpillar", "Pig and Pepper", "A Mad...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail/associations/habtm_spec.rb
spec/paper_trail/associations/habtm_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe(::PaperTrail, versioning: true) do after do Timecop.return end context "foo and bar" do before do @foo = FooHabtm.create(name: "foo") Timecop.travel(1.second.since) end context "where the association is created betw...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail/associations/has_many_spec.rb
spec/paper_trail/associations/has_many_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe(::PaperTrail, versioning: true) do after do Timecop.return end describe "customer, reified from version before order created" do it "has no orders" do customer = Customer.create(name: "customer_0") customer.update!(name: "cu...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail/associations/has_one_spec.rb
spec/paper_trail/associations/has_one_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe(::PaperTrail, versioning: true) do after do Timecop.return end describe "widget, reified from a version prior to creation of wotsit" do it "has a nil wotsit" do widget = Widget.create(name: "widget_0") widget.update(name: "w...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/paper_trail/associations/belongs_to_spec.rb
spec/paper_trail/associations/belongs_to_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe(::PaperTrail, versioning: true) do after do Timecop.return end context "wotsit belongs_to widget" do before { @widget = Widget.create(name: "widget_0") } context "where the association is created between model versions" do be...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/controllers/widgets_controller_spec.rb
spec/controllers/widgets_controller_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe WidgetsController, type: :controller, versioning: true do before do end after do RequestStore.store[:paper_trail] = nil end describe "#create" do context "PT enabled" do #it "stores information like IP address in version" do ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/models/person_spec.rb
spec/models/person_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe Person, type: :model, versioning: true do it "baseline test setup" do expect(Person.new).to be_versioned end describe "#cars and bicycles" do it "can be reified" do person = Person.create(name: "Frank") car = Car.create(name...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/models/note_spec.rb
spec/models/note_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe Note, type: :model, versioning: true do it "baseline test setup" do expect(Note.new).to be_versioned end describe "#object" do it "can be reified" do person = Person.create!(name: "Marielle") note = Note.create!(body: "Note ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/models/pet_spec.rb
spec/models/pet_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe Pet, type: :model, versioning: true do it "baseline test setup" do expect(Pet.new).to be_versioned end it "can be reified" do person = Person.create(name: "Frank") dog = Dog.create(name: "Snoopy") cat = Cat.create(name: "Garfiel...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/models/family/family_spec.rb
spec/models/family/family_spec.rb
# frozen_string_literal: true require "spec_helper" module Family RSpec.describe Family, type: :model, versioning: true do describe "#reify" do context "belongs_to" do it "uses the correct item_type in queries" do parent = described_class.new(name: "parent1") parent.children.bu...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/generators/paper_trail_association_tracking/add_foreign_type_to_version_associations_generator_spec.rb
spec/generators/paper_trail_association_tracking/add_foreign_type_to_version_associations_generator_spec.rb
# frozen_string_literal: true require "spec_helper" require "generator_spec/test_case" require File.expand_path("../../../../lib/generators/paper_trail_association_tracking/add_foreign_type_to_version_associations_generator", __FILE__) RSpec.describe PaperTrailAssociationTracking::AddForeignTypeToVersionAssociationsG...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/spec/generators/paper_trail_association_tracking/install_generator_spec.rb
spec/generators/paper_trail_association_tracking/install_generator_spec.rb
# frozen_string_literal: true require "spec_helper" require "generator_spec/test_case" require File.expand_path("../../../../lib/generators/paper_trail_association_tracking/install_generator", __FILE__) RSpec.describe PaperTrailAssociationTracking::InstallGenerator, type: :generator do include GeneratorSpec::TestCa...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/paper_trail-association_tracking.rb
lib/paper_trail-association_tracking.rb
# frozen_string_literal: true require 'paper_trail' require "paper_trail_association_tracking/config" require "paper_trail_association_tracking/model_config" require "paper_trail_association_tracking/reifier" require "paper_trail_association_tracking/record_trail" require "paper_trail_association_tracking/request" req...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/generators/paper_trail_association_tracking/add_foreign_type_to_version_associations_generator.rb
lib/generators/paper_trail_association_tracking/add_foreign_type_to_version_associations_generator.rb
# frozen_string_literal: true require "rails/generators" require "rails/generators/active_record" module PaperTrailAssociationTracking # Installs PaperTrail in a rails app. class AddForeignTypeToVersionAssociationsGenerator < ::Rails::Generators::Base include ::Rails::Generators::Migration # Class names ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/generators/paper_trail_association_tracking/install_generator.rb
lib/generators/paper_trail_association_tracking/install_generator.rb
# frozen_string_literal: true require "rails/generators" require "rails/generators/active_record" module PaperTrailAssociationTracking # Installs PaperTrail in a rails app. class InstallGenerator < ::Rails::Generators::Base include ::Rails::Generators::Migration # Class names of MySQL adapters. # - `...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/paper_trail_association_tracking/version_concern.rb
lib/paper_trail_association_tracking/version_concern.rb
# frozen_string_literal: true module PaperTrailAssociationTracking module VersionConcern extend ::ActiveSupport::Concern included do # Since the test suite has test coverage for this, we want to declare the association when the test suite is running. # This makes it pass when DB is not initializ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/paper_trail_association_tracking/reifier.rb
lib/paper_trail_association_tracking/reifier.rb
# frozen_string_literal: true require "paper_trail_association_tracking/reifiers/belongs_to" require "paper_trail_association_tracking/reifiers/has_and_belongs_to_many" require "paper_trail_association_tracking/reifiers/has_many" require "paper_trail_association_tracking/reifiers/has_many_through" require "paper_trail...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/paper_trail_association_tracking/version.rb
lib/paper_trail_association_tracking/version.rb
# frozen_string_literal: true module PaperTrailAssociationTracking VERSION = "2.3.0".freeze end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/paper_trail_association_tracking/record_trail.rb
lib/paper_trail_association_tracking/record_trail.rb
# frozen_string_literal: true module PaperTrailAssociationTracking module RecordTrail # Utility method for reifying. Anything executed inside the block will # appear like a new record. # # > .. as best as I can tell, the purpose of # > appear_as_new_record was to attempt to prevent the callbacks ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/paper_trail_association_tracking/paper_trail.rb
lib/paper_trail_association_tracking/paper_trail.rb
# frozen_string_literal: true module PaperTrailAssociationTracking module PaperTrail module ClassMethods def transaction? ::ActiveRecord::Base.connection.open_transactions.positive? end end end end
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/paper_trail_association_tracking/version_association_concern.rb
lib/paper_trail_association_tracking/version_association_concern.rb
# frozen_string_literal: true module PaperTrailAssociationTracking # Functionality for `PaperTrail::VersionAssociation`. Exists in a module # for the same reasons outlined in version_concern.rb. module VersionAssociationConcern extend ::ActiveSupport::Concern included do belongs_to :version en...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/paper_trail_association_tracking/config.rb
lib/paper_trail_association_tracking/config.rb
# frozen_string_literal: true module PaperTrailAssociationTracking module Config def association_reify_error_behaviour=(val) val = val.to_s if ['error', 'warn', 'ignore'].include?(val.to_s) @association_reify_error_behaviour = val.to_s else raise ArgumentError.new('Incorrect val...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/paper_trail_association_tracking/model_config.rb
lib/paper_trail_association_tracking/model_config.rb
# frozen_string_literal: true module PaperTrailAssociationTracking # Configures an ActiveRecord model, mostly at application boot time, but also # sometimes mid-request, with methods like enable/disable. module ModelConfig # Set up `@model_class` for PaperTrail. Installs callbacks, associations, # "class...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/paper_trail_association_tracking/request.rb
lib/paper_trail_association_tracking/request.rb
# frozen_string_literal: true module PaperTrailAssociationTracking module Request module ClassMethods # @api private def clear_transaction_id self.transaction_id = nil end # @api private def transaction_id store[:transaction_id] end # @api private ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/paper_trail_association_tracking/reifiers/has_many_through.rb
lib/paper_trail_association_tracking/reifiers/has_many_through.rb
# frozen_string_literal: true module PaperTrailAssociationTracking module Reifiers # Reify a single HMT association of `model`. # @api private module HasManyThrough class << self # @api private def reify(assoc, model, options, transaction_id) # Load the collection of throu...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/paper_trail_association_tracking/reifiers/has_one.rb
lib/paper_trail_association_tracking/reifiers/has_one.rb
# frozen_string_literal: true module PaperTrailAssociationTracking module Reifiers # Reify a single `has_one` association of `model`. # @api private module HasOne # A more helpful error message, instead of the AssociationTypeMismatch # you would get if, eg. we were to try to assign a Bicycle ...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false
westonganger/paper_trail-association_tracking
https://github.com/westonganger/paper_trail-association_tracking/blob/93a1c8359e55136bdea7e3053e23c2b45acb6dce/lib/paper_trail_association_tracking/reifiers/has_and_belongs_to_many.rb
lib/paper_trail_association_tracking/reifiers/has_and_belongs_to_many.rb
# frozen_string_literal: true module PaperTrailAssociationTracking module Reifiers # Reify a single HABTM association of `model`. # @api private module HasAndBelongsToMany class << self # @api private def reify(pt_enabled, assoc, model, options, transaction_id) version_ids...
ruby
MIT
93a1c8359e55136bdea7e3053e23c2b45acb6dce
2026-01-04T17:34:04.567102Z
false