rails_log_book 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/log_book/railtie.rb +8 -0
- data/lib/log_book/recorder.rb +1 -0
- data/lib/log_book/version.rb +1 -1
- data/lib/rails_log_book.rb +1 -0
- data/lib/tasks/log_book.rake +11 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67d0353c0e186e2a8264652e9f9c98deb83373bc
|
4
|
+
data.tar.gz: 9b95ba2e4073d819ade42d82b4f25db38936d53f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56f0e225cab9b1f90cd07a20ce44461844b8f0ff46cbdd39e2b0b3c270f73fd2606dddea2f24b7fa995bb13d7f4fbbee1f019fe4b5cf9dfa3295b0a6313fd5d5
|
7
|
+
data.tar.gz: f5a82f48790adf8927013a4a4ab14ef42ed354ea924e65a6a3b137911a019cc6b52bf3136272ae0303ddbed9f752fb1885cb99263324c3e833aa980e14731fa5
|
data/lib/log_book/recorder.rb
CHANGED
@@ -9,6 +9,7 @@ module LogBook
|
|
9
9
|
self.recording_options = options
|
10
10
|
|
11
11
|
has_many :records, -> { order(created_at: :asc) }, as: :subject, class_name: 'LogBook::Record'
|
12
|
+
scope :with_records, -> { joins(:records) }
|
12
13
|
|
13
14
|
on = Array.wrap(options[:on])
|
14
15
|
after_create :create_record if on.empty? || on.include?(:create)
|
data/lib/log_book/version.rb
CHANGED
data/lib/rails_log_book.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
namespace :log_book do
|
2
|
+
desc 'Update meta of CLASS'
|
3
|
+
task update_meta: :environment do
|
4
|
+
ENV['CLASS'].constantize.with_records.each do |model|
|
5
|
+
model.records.each do |record|
|
6
|
+
record.meta = record.meta.reverse_merge(model.log_book_meta(record).stringify_keys)
|
7
|
+
record.save
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_log_book
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stjepan Hadjic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -151,11 +151,13 @@ files:
|
|
151
151
|
- lib/generators/log_book/templates/install.rb
|
152
152
|
- lib/log_book/configuration.rb
|
153
153
|
- lib/log_book/controller_record.rb
|
154
|
+
- lib/log_book/railtie.rb
|
154
155
|
- lib/log_book/record.rb
|
155
156
|
- lib/log_book/recorder.rb
|
156
157
|
- lib/log_book/squash_records.rb
|
157
158
|
- lib/log_book/version.rb
|
158
159
|
- lib/rails_log_book.rb
|
160
|
+
- lib/tasks/log_book.rake
|
159
161
|
- log_book.gemspec
|
160
162
|
homepage: https://github.com/infinum/rails_log_book
|
161
163
|
licenses:
|