-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from VegetableProphet/refactoring
Heavy refactoring
- Loading branch information
Showing
17 changed files
with
367 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
inherit_gem: | ||
rubocop-config-umbrellio: lib/rubocop.yml | ||
|
||
AllCops: | ||
TargetRubyVersion: 2.4.7 | ||
|
||
Naming/FileName: | ||
Exclude: | ||
- lib/sequel-bulk-audit.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
|
||
## [1.0.0] - 2020-02-18 | ||
|
||
### Added | ||
|
||
- integration with rubocop ecosystem | ||
|
||
### Changed | ||
|
||
- instead of creating model_to_table_map temp table now keeps just model_name | ||
- temp table now drops on commit | ||
- temp table now named as "__schema_table_audit_logs_trid" | ||
- temp table now has array of audited table columns | ||
- trigger function now uses array of columns from temp table instead of querying for them | ||
- remade specs | ||
- readme | ||
- isolated tests | ||
- incapsulated preparations for tests in SeedHelper | ||
|
||
### Removed | ||
|
||
- redundant self | ||
- redundant excluded columns option | ||
- ability to use #with_current_user on instances of audited class | ||
- spec for polymorhic associations | ||
|
||
## [0.2.0] - 2018-06-08 | ||
|
||
Initial version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | ||
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } | ||
|
||
# Specify your gem's dependencies in sequel-bulk-audit.gemspec | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
require "bundler/gem_tasks" | ||
require "rspec/core/rake_task" | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task :default => :spec | ||
task default: :spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
class AuditMigrationGenerator < Rails::Generators::Base | ||
source_root File.expand_path('../templates', __FILE__) | ||
source_root File.expand_path("templates", __dir__) | ||
|
||
def copy_audit_migration_files | ||
version = Time.now.utc.strftime('%Y%m%d%H%M%S') | ||
version = Time.now.utc.strftime("%Y%m%d%H%M%S") | ||
copy_file "01_migration.rb", "db/migrate/#{version}_CreateAuditTableAndTrigger.rb" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
require "pry" | ||
require "sequel/plugins/bulk_audit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
module Sequel | ||
module Plugins | ||
module BulkAudit | ||
VERSION = "0.2.0" | ||
VERSION = "1.0.0" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# coding: utf-8 | ||
lib = File.expand_path("../lib", __FILE__) | ||
# frozen_string_literal: true | ||
|
||
lib = File.expand_path("lib", __dir__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
require "sequel/plugins/bulk_audit/version" | ||
|
||
|
@@ -9,28 +11,28 @@ Gem::Specification.new do |spec| | |
spec.authors = ["Fox"] | ||
spec.email = ["[email protected]"] | ||
|
||
spec.summary = %q{This gem provides a trigger based solution for auditing table changes} | ||
spec.description = %q{Every update on audited table will be logged. You can update the table in bulk} | ||
spec.homepage = "https://github.com/fiscal-cliff/sequel-bulk-audit/" | ||
spec.post_install_message = %q{ Next steps: | ||
spec.summary = "This gem provides a trigger based solution for auditing table changes" | ||
spec.description = "Every update on audited table will be logged. You can update in bulk" | ||
spec.homepage = "https://github.com/umbrellio/sequel-bulk-audit/" | ||
spec.post_install_message = ' Next steps: | ||
1. Run rails g audit_migration | ||
2. Edit generated migration | ||
3. Apply the migration" | ||
} | ||
' | ||
|
||
spec.files = `git ls-files -z`.split("\x0").reject do |f| | ||
spec.files = `git ls-files -z`.split("\x0").reject do |f| | ||
f.match(%r{^(test|spec|features)/}) | ||
end | ||
spec.bindir = "exe" | ||
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } | ||
spec.require_paths = ["lib"] | ||
|
||
spec.add_dependency "pg", ">= 0.17.0" | ||
spec.add_dependency "sequel", ">= 4.0.0" | ||
spec.add_dependency "pg", ">= 0.17.0" | ||
|
||
spec.add_development_dependency "bundler", "~> 1.14" | ||
spec.add_development_dependency "rake", "~> 10.0" | ||
spec.add_development_dependency "rspec", "~> 3.0" | ||
spec.add_development_dependency "pry", "~> 0.10" | ||
spec.add_development_dependency "sequel_polymorphic" | ||
spec.add_development_dependency "bundler", "~> 2.0" | ||
spec.add_development_dependency "pry", "~> 0.10" | ||
spec.add_development_dependency "rake", "~> 10.0" | ||
spec.add_development_dependency "rspec", "~> 3.0" | ||
spec.add_development_dependency "rubocop-config-umbrellio" | ||
end |
Oops, something went wrong.