logga 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d43f622f0a3a93ff1d9ebabdc1991ec4264457b
4
- data.tar.gz: b335aabbe73612f869fab754f0d4c8f4e4ecf5ca
3
+ metadata.gz: aae0ca451a0ea14aa19f57a87183fcb0311eff29
4
+ data.tar.gz: 5c970997159c359fad7bb552080afaddf998b580
5
5
  SHA512:
6
- metadata.gz: 1380ada33016abd3639f1c7dcac1b40f00fd75dbb3383609207a33a26260a3c5b80086df1b5f69866a046f4a5ca1ea3cdd222c67f82f5673388ea380b86a78c7
7
- data.tar.gz: 7de598ea672562c2a130be403c342473c391694f673894fadb36bdfd4543db6e8d889cf8e9a755a2d32f222f022551f94f50b9dff402ff7ca2ffa68568bd111e
6
+ metadata.gz: 47a3115e724d308d70d6e3b4c904a9d32c6e54561e7fb2fb169045ef37d48c6843f72db676ff5f6368ab880ac09afa0a4f3f53c2fd2bf24d6fca7bad2246fa15
7
+ data.tar.gz: c8701154a50b687b5eca8be21c251483622bbe8cb0b2766a80a7c796a555840210c24af989921f764f0d0acda2fe62184d4ae64b6c585f8b9632acd370be8dcd
@@ -50,6 +50,8 @@ module Logga
50
50
  end
51
51
  end
52
52
 
53
+ private
54
+
53
55
  def author_data
54
56
  data = Hash(log_receiver.try(:author) || try(:author)).with_indifferent_access
55
57
  {
@@ -61,20 +63,24 @@ module Logga
61
63
 
62
64
  def default_creation_log_body(record)
63
65
  [
64
- "#{record.class.name.demodulize} created",
66
+ "#{titleized_model_class_name(record)} created",
65
67
  ("(#{record.state})" if record.try(:state))
66
68
  ].compact.join(' ')
67
69
  end
68
70
 
69
71
  def default_change_log_body(record, field, old_value, new_value)
70
- "#{record.class.name.demodulize.titleize} #{field} set to #{new_value}"
72
+ "#{titleized_model_class_name(record)} #{field} set to #{new_value}"
71
73
  end
72
74
 
73
75
  def default_deletion_log_body(record)
74
76
  [
75
- "#{record.class.name.demodulize} removed",
77
+ "#{titleized_model_class_name(record)} removed",
76
78
  ("(#{record.name})" if record.try(:name))
77
79
  ].compact.join(' ')
78
80
  end
81
+
82
+ def titleized_model_class_name(record)
83
+ record.class.name.demodulize.titleize
84
+ end
79
85
  end
80
86
  end
data/lib/logga/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Logga
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logga
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Chinery, Rob Hesketh, Lorenzo Tello