active-audit 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: e1fca837bb3e2d692f664310ebe1beffad3484bd
4
- data.tar.gz: a7f74a56a41b4443b00de87699df32bef7278d48
3
+ metadata.gz: fa8159ff95a78b6fecf5ff894ab710960a218fbf
4
+ data.tar.gz: f966c8327ddaaf055b640ad82193ec45420f848c
5
5
  SHA512:
6
- metadata.gz: 5cc11c9ece3877bac607d8083b56bf40e649a929c91768abe22174cdf32527b93c60bc4c917d6e529f79e704957cbd0fc509b27061c3608dba2cc82938fbe8e6
7
- data.tar.gz: 9d089b1ac422adf173792fa6a4ae1c326c9bc62cbf1d951bdda6bb9ea9ae92bd811add470032b166530606dd12718316b2f53870ff5c91d2d7f52d3e287af24b
6
+ metadata.gz: f3f737364853708a070513a85d09adbb333ff3eb0a888aa41df2fad8595d88a13d35c6ed76736b75d64a9736e0780211d78dc07ffcb55200bed7f7c0734be4c5
7
+ data.tar.gz: 341f2312ce6f80c4b589d5a0886039722b03d3e7493906278ba9cfa7c189bdc0bf2977a56a071d57b8e3d82e937fc20c9d8aec00c5dd5f46e55f3afeb4342d1f
@@ -12,9 +12,7 @@ module ActiveAudit
12
12
  through_id = reflection.foreign_key
13
13
  through_name = through_refl.name
14
14
  define_association_method_suffix association_name
15
- ActiveRecord::Associations::Builder::CollectionAssociation.define_callback(self, :after_add, through_name, before_add: lambda do |model, relation|
16
- puts "addubng"
17
- puts relation.attributes
15
+ ActiveRecord::Associations::Builder::CollectionAssociation.define_callback(self, :before_add, through_name, before_add: lambda do |model, relation|
18
16
  DirtyAssociation.record_add association_name, model, relation, through_name, through_id
19
17
  end)
20
18
  ActiveRecord::Associations::Builder::CollectionAssociation.define_callback(self, :before_remove, through_name, before_remove: lambda do |model, relation|
@@ -8,17 +8,14 @@ module ActiveAudit
8
8
 
9
9
  desc "Create initializer and config files for active audit base on the adapter you define. In case of 'active_record' adapter a migration will be generated as well."
10
10
 
11
- argument :adapter, required: true, type: :string, desc: "The name of the storage adapter you want to use.",
11
+ argument :adapter, required: true, type: :string, default: "test", desc: "The name of the storage adapter you want to use.",
12
12
  :banner => "adapter_name"
13
13
 
14
14
  source_root File.expand_path("../templates", __FILE__)
15
15
 
16
16
  def copy_initializer_file
17
17
  template "initializer.rb", "config/initializers/active_audit.rb"
18
- end
19
-
20
- def copy_config_file
21
- unless adapter == 'active_record'
18
+ unless adapter == 'active_record' || adapter == 'test'
22
19
  copy_file "#{adapter}_config.yml", "config/active_audit.yml"
23
20
  end
24
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-audit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tariq Abughofa