acts_as_commentable_more 1.2.2 → 1.2.3

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: a700a1c603c1dff97419b559c0f72a3fcfbe0c70
4
- data.tar.gz: cdab54377ee4ab193bc2db96b63860f8ff96db03
3
+ metadata.gz: 6df043ba166bd6129581d78d8496c2cfad6f9996
4
+ data.tar.gz: 5b0b4733b0ee6e62b275ca293bf6f5ca649320a5
5
5
  SHA512:
6
- metadata.gz: 493e49085a113635c59a4fa3e5d48816840eb792d88c2edb9605209036a259ff811d5fe1fb89ec4fa6d49e24c05b480fb5c68f3b5841578f763fd94febaa0fb6
7
- data.tar.gz: 77c8f29135dc326f76564dc61ee3f6f729d33f2ef3b5317e070955cf663c61001c7a0cae24d4a604a7ba5c2399d89511d3fbc3b2bab913c51e0111e2d8532789
6
+ metadata.gz: 02e3d613250fbce7d82a5d99379a856bf14d96198ae5822e8d4f5ddd4695adb432c04714dd52626a2b9924b07d76a9f0708611e83472a62079b40d15bda47498
7
+ data.tar.gz: 2383cccaa8de0f02b745d1a0e53199d5af0afe180304bc311c6388d7997e91c980c4032fb2afb7727131f0a0f18d4a1a160b1ca22dc17ad32a69b4c480186834
@@ -47,7 +47,12 @@ module ActsAsCommentableMore
47
47
 
48
48
  # setting attributes for read only
49
49
  post_model = self
50
- counter_fields = post_model.column_names.select { |column| column =~ /.*(_count)$/ }
50
+ counter_fields = ["#{association_comment_name.to_s}_count"]
51
+ if post_model.comment_roles.size > 1
52
+ post_model.comment_roles.each do |role|
53
+ counter_fields << "#{role.to_s}_#{association_comment_name.to_s}_count"
54
+ end
55
+ end
51
56
  post_model.attr_readonly(*counter_fields)
52
57
  end
53
58
 
@@ -1,3 +1,3 @@
1
1
  module ActsAsCommentableMore
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_commentable_more
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - piya23300