content_flagging 1.0.0

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.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +52 -0
  3. data/LICENSE +21 -0
  4. data/README.md +143 -0
  5. data/Rakefile +5 -0
  6. data/content_flagging.gemspec +48 -0
  7. data/dummy_app/.dockerignore +37 -0
  8. data/dummy_app/.ruby-version +1 -0
  9. data/dummy_app/Dockerfile +62 -0
  10. data/dummy_app/Gemfile +65 -0
  11. data/dummy_app/Gemfile.lock +286 -0
  12. data/dummy_app/README.md +24 -0
  13. data/dummy_app/Rakefile +6 -0
  14. data/dummy_app/app/assets/config/manifest.js +2 -0
  15. data/dummy_app/app/assets/images/.keep +0 -0
  16. data/dummy_app/app/assets/stylesheets/application.css +15 -0
  17. data/dummy_app/app/channels/application_cable/channel.rb +4 -0
  18. data/dummy_app/app/channels/application_cable/connection.rb +4 -0
  19. data/dummy_app/app/controllers/application_controller.rb +2 -0
  20. data/dummy_app/app/controllers/concerns/.keep +0 -0
  21. data/dummy_app/app/helpers/application_helper.rb +2 -0
  22. data/dummy_app/app/jobs/application_job.rb +7 -0
  23. data/dummy_app/app/mailers/application_mailer.rb +4 -0
  24. data/dummy_app/app/models/application_record.rb +3 -0
  25. data/dummy_app/app/models/concerns/.keep +0 -0
  26. data/dummy_app/app/models/post.rb +3 -0
  27. data/dummy_app/app/models/user.rb +2 -0
  28. data/dummy_app/app/views/layouts/application.html.erb +15 -0
  29. data/dummy_app/app/views/layouts/mailer.html.erb +13 -0
  30. data/dummy_app/app/views/layouts/mailer.text.erb +1 -0
  31. data/dummy_app/bin/docker-entrypoint +8 -0
  32. data/dummy_app/bin/rails +4 -0
  33. data/dummy_app/bin/rake +4 -0
  34. data/dummy_app/bin/setup +33 -0
  35. data/dummy_app/config/application.rb +42 -0
  36. data/dummy_app/config/boot.rb +4 -0
  37. data/dummy_app/config/cable.yml +10 -0
  38. data/dummy_app/config/credentials.yml.enc +1 -0
  39. data/dummy_app/config/database.yml +25 -0
  40. data/dummy_app/config/environment.rb +5 -0
  41. data/dummy_app/config/environments/development.rb +76 -0
  42. data/dummy_app/config/environments/production.rb +97 -0
  43. data/dummy_app/config/environments/test.rb +64 -0
  44. data/dummy_app/config/initializers/assets.rb +12 -0
  45. data/dummy_app/config/initializers/content_security_policy.rb +25 -0
  46. data/dummy_app/config/initializers/filter_parameter_logging.rb +8 -0
  47. data/dummy_app/config/initializers/inflections.rb +16 -0
  48. data/dummy_app/config/initializers/permissions_policy.rb +13 -0
  49. data/dummy_app/config/locales/en.yml +31 -0
  50. data/dummy_app/config/master.key +1 -0
  51. data/dummy_app/config/puma.rb +44 -0
  52. data/dummy_app/config/routes.rb +10 -0
  53. data/dummy_app/config/storage.yml +34 -0
  54. data/dummy_app/config.ru +6 -0
  55. data/dummy_app/db/migrate/20250920174734_create_content_flags.rb +13 -0
  56. data/dummy_app/db/migrate/20250920174750_create_posts.rb +10 -0
  57. data/dummy_app/db/migrate/20250920174757_create_users.rb +9 -0
  58. data/dummy_app/db/schema.rb +40 -0
  59. data/dummy_app/db/seeds.rb +9 -0
  60. data/dummy_app/lib/assets/.keep +0 -0
  61. data/dummy_app/lib/tasks/.keep +0 -0
  62. data/dummy_app/public/404.html +67 -0
  63. data/dummy_app/public/422.html +67 -0
  64. data/dummy_app/public/500.html +66 -0
  65. data/dummy_app/public/apple-touch-icon-precomposed.png +0 -0
  66. data/dummy_app/public/apple-touch-icon.png +0 -0
  67. data/dummy_app/public/favicon.ico +0 -0
  68. data/dummy_app/public/robots.txt +1 -0
  69. data/dummy_app/storage/.keep +0 -0
  70. data/dummy_app/test_console.rb +46 -0
  71. data/dummy_app/vendor/.keep +0 -0
  72. data/example_usage.rb +46 -0
  73. data/lib/content_flagging/configuration.rb +9 -0
  74. data/lib/content_flagging/flag.rb +36 -0
  75. data/lib/content_flagging/flaggable.rb +46 -0
  76. data/lib/content_flagging/version.rb +3 -0
  77. data/lib/content_flagging.rb +22 -0
  78. data/lib/generators/content_flagging/install_generator.rb +24 -0
  79. data/lib/generators/content_flagging/templates/content_flagging.rb +4 -0
  80. data/lib/generators/content_flagging/templates/create_content_flags.rb.erb +13 -0
  81. data/test_manual.rb +36 -0
  82. metadata +342 -0
File without changes
File without changes
File without changes
@@ -0,0 +1 @@
1
+ # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
File without changes
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env ruby
2
+ # Rails Console Test Script for ContentFlagging
3
+
4
+ puts "=== ContentFlagging Rails Console Test ==="
5
+ puts "Run: rails console"
6
+ puts "Then copy/paste these commands:"
7
+ puts
8
+
9
+ puts <<~RUBY
10
+ # 1. Create test data
11
+ post1 = Post.create(title: "Normal Post")
12
+ post2 = Post.create(title: "Controversial Post")
13
+ user = User.create(name: "Test User")
14
+
15
+ # 2. Check initial state
16
+ puts "Initial posts count: \#{Post.count}"
17
+ puts "Post2 flagged?: \#{post2.flagged?}"
18
+ puts "Post2 flag count: \#{post2.flag_count}"
19
+
20
+ # 3. Flag the post (below threshold)
21
+ post2.flag!(flagged_by: user)
22
+ post2.flag!
23
+ puts "After 2 flags - Post2 flagged?: \#{post2.flagged?}"
24
+ puts "Posts in default scope: \#{Post.count}"
25
+
26
+ # 4. Hit the threshold (3 flags)
27
+ post2.flag!
28
+ puts "After 3 flags - Post2 flagged?: \#{post2.flagged?}"
29
+ puts "Post2 flagged at: \#{post2.flagged_at}"
30
+ puts "Posts in default scope: \#{Post.count}"
31
+ puts "Posts with flagged: \#{Post.with_flagged.count}"
32
+
33
+ # 5. Test scopes
34
+ puts "Flagged posts: \#{Post.with_flagged.flagged.count}"
35
+ puts "Not flagged posts: \#{Post.not_flagged.count}"
36
+
37
+ # 6. Unflag
38
+ post2.unflag!(flagged_by: user)
39
+ puts "After unflagging - Post2 flagged?: \#{post2.flagged?}"
40
+ puts "Posts in default scope: \#{Post.count}"
41
+ RUBY
42
+
43
+ puts
44
+ puts "=== Quick Test Commands ==="
45
+ puts "Post.create(title: 'Test').tap { |p| 3.times { p.flag! } }.flagged?"
46
+ puts "Post.count vs Post.with_flagged.count"
File without changes
data/example_usage.rb ADDED
@@ -0,0 +1,46 @@
1
+ # Example usage in a Rails application
2
+
3
+ # 1. Model setup
4
+ class Post < ApplicationRecord
5
+ acts_as_flaggable
6
+ # Requires: flagged_count integer column (default: 0)
7
+ end
8
+
9
+ class Comment < ApplicationRecord
10
+ acts_as_flaggable threshold: 5
11
+ end
12
+
13
+ class User < ApplicationRecord
14
+ # Can flag content
15
+ end
16
+
17
+ # 2. Configuration (config/initializers/content_flagging.rb)
18
+ ContentFlagging.configure do |config|
19
+ config.flag_threshold = 3
20
+ end
21
+
22
+ # 3. Usage examples
23
+ post = Post.create(title: "Controversial Post")
24
+ user1 = User.create(name: "User 1")
25
+ user2 = User.create(name: "User 2")
26
+
27
+ # Flag the post
28
+ post.flag!(flagged_by: user1)
29
+ post.flag!(flagged_by: user2)
30
+ post.flag_count # => 2
31
+ post.flagged? # => false
32
+
33
+ # Third flag triggers threshold
34
+ post.flag!
35
+ post.flagged? # => true
36
+
37
+ # Post is now excluded from default scope
38
+ Post.all # Won't include this post
39
+ Post.with_flagged.all # Will include this post
40
+ Post.with_flagged.flagged # Returns only flagged posts
41
+ Post.not_flagged # Returns only non-flagged posts
42
+
43
+ # Unflagging
44
+ post.unflag!(flagged_by: user1)
45
+ post.flag_count # => 2
46
+ post.flagged? # => false (back in default scope)
@@ -0,0 +1,9 @@
1
+ module ContentFlagging
2
+ class Configuration
3
+ attr_accessor :flag_threshold
4
+
5
+ def initialize
6
+ @flag_threshold = 3
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,36 @@
1
+ module ContentFlagging
2
+ class Flag < ActiveRecord::Base
3
+ self.table_name = 'content_flags'
4
+
5
+ belongs_to :flaggable, polymorphic: true
6
+ belongs_to :flagged_by, polymorphic: true, optional: true
7
+
8
+ validates :flaggable, presence: true
9
+ validates :flagged_at, presence: true
10
+
11
+ before_validation :set_flagged_at, on: :create
12
+ after_create :increment_flagged_count
13
+ after_destroy :decrement_flagged_count
14
+
15
+ private
16
+
17
+ def set_flagged_at
18
+ self.flagged_at ||= Time.current
19
+ end
20
+
21
+ def increment_flagged_count
22
+ flaggable.class.where(id: flaggable.id).update_all(
23
+ 'flagged_count = COALESCE(flagged_count, 0) + 1, flagged_at = CASE WHEN COALESCE(flagged_count, 0) = 0 THEN ? ELSE flagged_at END',
24
+ flagged_at
25
+ )
26
+ flaggable.reload
27
+ end
28
+
29
+ def decrement_flagged_count
30
+ count_sql = 'flagged_count = GREATEST(COALESCE(flagged_count, 0) - 1, 0)'
31
+ flagged_at_sql = 'flagged_at = CASE WHEN GREATEST(COALESCE(flagged_count, 0) - 1, 0) = 0 THEN NULL ELSE flagged_at END'
32
+ flaggable.class.where(id: flaggable.id).update_all("#{count_sql}, #{flagged_at_sql}")
33
+ flaggable.reload
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,46 @@
1
+ module ContentFlagging
2
+ module Flaggable
3
+ module ClassMethods
4
+ def acts_as_flaggable(options = {})
5
+ threshold = options[:threshold] || ContentFlagging.config.flag_threshold
6
+
7
+ has_many :flags, as: :flaggable, class_name: 'ContentFlagging::Flag', dependent: :destroy
8
+
9
+ scope :not_flagged, -> { where('COALESCE(flagged_count, 0) < ?', threshold) }
10
+ scope :flagged, -> { where('flagged_count >= ?', threshold) }
11
+ scope :with_flagged, -> { unscoped }
12
+
13
+ default_scope { not_flagged }
14
+
15
+ include ContentFlagging::Flaggable::InstanceMethods
16
+
17
+ class_attribute :flag_threshold
18
+ self.flag_threshold = threshold
19
+ end
20
+ end
21
+
22
+ module InstanceMethods
23
+ def flag!(flagged_by: nil)
24
+ flags.create!(flagged_by: flagged_by)
25
+ end
26
+
27
+ def unflag!(flagged_by: nil)
28
+ flag_record = flagged_by ? flags.where(flagged_by: flagged_by).first : flags.first
29
+ flag_record&.destroy
30
+ end
31
+
32
+ def flagged?
33
+ (flagged_count || 0) >= self.class.flag_threshold
34
+ end
35
+
36
+ def flag_count
37
+ flagged_count || 0
38
+ end
39
+
40
+ def flagged_at
41
+ return nil unless flagged?
42
+ read_attribute(:flagged_at) || flags.minimum(:flagged_at)
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,3 @@
1
+ module ContentFlagging
2
+ VERSION = '1.0.0'
3
+ end
@@ -0,0 +1,22 @@
1
+ require 'active_record'
2
+ require 'content_flagging/version'
3
+ require 'content_flagging/flaggable'
4
+ require 'content_flagging/flag'
5
+ require 'content_flagging/configuration'
6
+
7
+ module ContentFlagging
8
+ class << self
9
+ attr_accessor :configuration
10
+ end
11
+
12
+ def self.configure
13
+ self.configuration ||= Configuration.new
14
+ yield(configuration)
15
+ end
16
+
17
+ def self.config
18
+ self.configuration ||= Configuration.new
19
+ end
20
+ end
21
+
22
+ ActiveRecord::Base.extend(ContentFlagging::Flaggable::ClassMethods)
@@ -0,0 +1,24 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/migration'
3
+
4
+ module ContentFlagging
5
+ module Generators
6
+ class InstallGenerator < Rails::Generators::Base
7
+ include Rails::Generators::Migration
8
+
9
+ source_root File.expand_path('templates', __dir__)
10
+
11
+ def self.next_migration_number(path)
12
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
13
+ end
14
+
15
+ def create_migration
16
+ migration_template 'create_content_flags.rb.erb', 'db/migrate/create_content_flags.rb'
17
+ end
18
+
19
+ def create_initializer
20
+ template 'content_flagging.rb', 'config/initializers/content_flagging.rb'
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,4 @@
1
+ ContentFlagging.configure do |config|
2
+ # Set the threshold for flagged content to be excluded from default scope
3
+ config.flag_threshold = 3
4
+ end
@@ -0,0 +1,13 @@
1
+ class CreateContentFlags < ActiveRecord::Migration[7.0]
2
+ def change
3
+ create_table :content_flags do |t|
4
+ t.references :flaggable, polymorphic: true, null: false, index: true
5
+ t.references :flagged_by, polymorphic: true, null: true, index: true
6
+ t.datetime :flagged_at, null: false
7
+ t.timestamps
8
+ end
9
+
10
+ add_index :content_flags, [:flaggable_type, :flaggable_id, :flagged_by_type, :flagged_by_id],
11
+ unique: true, name: 'unique_flag_per_entity'
12
+ end
13
+ end
data/test_manual.rb ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative 'spec/spec_helper'
3
+
4
+ # Manual testing script
5
+ puts "Testing ContentFlagging gem..."
6
+
7
+ # Create test data
8
+ post = Post.create(title: "Test Post")
9
+ user = User.create(name: "Test User")
10
+
11
+ puts "\n1. Initial state:"
12
+ puts "Post flagged?: #{post.flagged?}"
13
+ puts "Flag count: #{post.flag_count}"
14
+ puts "Posts in default scope: #{Post.count}"
15
+
16
+ puts "\n2. Flag the post twice:"
17
+ post.flag!(flagged_by: user)
18
+ post.flag!
19
+ puts "Post flagged?: #{post.flagged?}"
20
+ puts "Flag count: #{post.flag_count}"
21
+ puts "Posts in default scope: #{Post.count}"
22
+
23
+ puts "\n3. Flag once more (hits threshold):"
24
+ post.flag!
25
+ puts "Post flagged?: #{post.flagged?}"
26
+ puts "Flag count: #{post.flag_count}"
27
+ puts "Posts in default scope: #{Post.count}"
28
+ puts "Posts with flagged: #{Post.with_flagged.count}"
29
+
30
+ puts "\n4. Unflag once:"
31
+ post.unflag!(flagged_by: user)
32
+ puts "Post flagged?: #{post.flagged?}"
33
+ puts "Flag count: #{post.flag_count}"
34
+ puts "Posts in default scope: #{Post.count}"
35
+
36
+ puts "\nTest completed!"
metadata ADDED
@@ -0,0 +1,342 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: content_flagging
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Arshdeep Singh
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2025-09-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activerecord
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '6.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '6.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '6.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '6.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: railties
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '6.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '6.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '13.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '13.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec-rails
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '5.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '5.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: sqlite3
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.4'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.4'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pg
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: mysql2
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.5'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.5'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rails
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '6.0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '6.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: factory_bot_rails
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '6.0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '6.0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubocop
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '1.0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '1.0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: rubocop-rails
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '2.0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '2.0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: simplecov
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '0.21'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '0.21'
223
+ description: A powerful Rails gem that automatically hides inappropriate content when
224
+ flagged. Like acts_as_paranoid for deleted records, acts_as_flaggable hides flagged
225
+ content from default scopes with configurable thresholds.
226
+ email:
227
+ - arsh199820@gmail.com
228
+ executables: []
229
+ extensions: []
230
+ extra_rdoc_files: []
231
+ files:
232
+ - ".gitignore"
233
+ - LICENSE
234
+ - README.md
235
+ - Rakefile
236
+ - content_flagging.gemspec
237
+ - dummy_app/.dockerignore
238
+ - dummy_app/.ruby-version
239
+ - dummy_app/Dockerfile
240
+ - dummy_app/Gemfile
241
+ - dummy_app/Gemfile.lock
242
+ - dummy_app/README.md
243
+ - dummy_app/Rakefile
244
+ - dummy_app/app/assets/config/manifest.js
245
+ - dummy_app/app/assets/images/.keep
246
+ - dummy_app/app/assets/stylesheets/application.css
247
+ - dummy_app/app/channels/application_cable/channel.rb
248
+ - dummy_app/app/channels/application_cable/connection.rb
249
+ - dummy_app/app/controllers/application_controller.rb
250
+ - dummy_app/app/controllers/concerns/.keep
251
+ - dummy_app/app/helpers/application_helper.rb
252
+ - dummy_app/app/jobs/application_job.rb
253
+ - dummy_app/app/mailers/application_mailer.rb
254
+ - dummy_app/app/models/application_record.rb
255
+ - dummy_app/app/models/concerns/.keep
256
+ - dummy_app/app/models/post.rb
257
+ - dummy_app/app/models/user.rb
258
+ - dummy_app/app/views/layouts/application.html.erb
259
+ - dummy_app/app/views/layouts/mailer.html.erb
260
+ - dummy_app/app/views/layouts/mailer.text.erb
261
+ - dummy_app/bin/docker-entrypoint
262
+ - dummy_app/bin/rails
263
+ - dummy_app/bin/rake
264
+ - dummy_app/bin/setup
265
+ - dummy_app/config.ru
266
+ - dummy_app/config/application.rb
267
+ - dummy_app/config/boot.rb
268
+ - dummy_app/config/cable.yml
269
+ - dummy_app/config/credentials.yml.enc
270
+ - dummy_app/config/database.yml
271
+ - dummy_app/config/environment.rb
272
+ - dummy_app/config/environments/development.rb
273
+ - dummy_app/config/environments/production.rb
274
+ - dummy_app/config/environments/test.rb
275
+ - dummy_app/config/initializers/assets.rb
276
+ - dummy_app/config/initializers/content_security_policy.rb
277
+ - dummy_app/config/initializers/filter_parameter_logging.rb
278
+ - dummy_app/config/initializers/inflections.rb
279
+ - dummy_app/config/initializers/permissions_policy.rb
280
+ - dummy_app/config/locales/en.yml
281
+ - dummy_app/config/master.key
282
+ - dummy_app/config/puma.rb
283
+ - dummy_app/config/routes.rb
284
+ - dummy_app/config/storage.yml
285
+ - dummy_app/db/migrate/20250920174734_create_content_flags.rb
286
+ - dummy_app/db/migrate/20250920174750_create_posts.rb
287
+ - dummy_app/db/migrate/20250920174757_create_users.rb
288
+ - dummy_app/db/schema.rb
289
+ - dummy_app/db/seeds.rb
290
+ - dummy_app/lib/assets/.keep
291
+ - dummy_app/lib/tasks/.keep
292
+ - dummy_app/public/404.html
293
+ - dummy_app/public/422.html
294
+ - dummy_app/public/500.html
295
+ - dummy_app/public/apple-touch-icon-precomposed.png
296
+ - dummy_app/public/apple-touch-icon.png
297
+ - dummy_app/public/favicon.ico
298
+ - dummy_app/public/robots.txt
299
+ - dummy_app/storage/.keep
300
+ - dummy_app/test_console.rb
301
+ - dummy_app/vendor/.keep
302
+ - example_usage.rb
303
+ - lib/content_flagging.rb
304
+ - lib/content_flagging/configuration.rb
305
+ - lib/content_flagging/flag.rb
306
+ - lib/content_flagging/flaggable.rb
307
+ - lib/content_flagging/version.rb
308
+ - lib/generators/content_flagging/install_generator.rb
309
+ - lib/generators/content_flagging/templates/content_flagging.rb
310
+ - lib/generators/content_flagging/templates/create_content_flags.rb.erb
311
+ - test_manual.rb
312
+ homepage: https://github.com/arshdeepsingh/content_flagging
313
+ licenses:
314
+ - MIT
315
+ metadata:
316
+ homepage_uri: https://github.com/arshdeepsingh/content_flagging
317
+ source_code_uri: https://github.com/arshdeepsingh/content_flagging
318
+ changelog_uri: https://github.com/arshdeepsingh/content_flagging/blob/main/CHANGELOG.md
319
+ bug_tracker_uri: https://github.com/arshdeepsingh/content_flagging/issues
320
+ documentation_uri: https://github.com/arshdeepsingh/content_flagging/blob/main/README.md
321
+ rubygems_mfa_required: 'true'
322
+ post_install_message:
323
+ rdoc_options: []
324
+ require_paths:
325
+ - lib
326
+ required_ruby_version: !ruby/object:Gem::Requirement
327
+ requirements:
328
+ - - ">="
329
+ - !ruby/object:Gem::Version
330
+ version: 2.7.0
331
+ required_rubygems_version: !ruby/object:Gem::Requirement
332
+ requirements:
333
+ - - ">="
334
+ - !ruby/object:Gem::Version
335
+ version: '0'
336
+ requirements: []
337
+ rubygems_version: 3.0.3.1
338
+ signing_key:
339
+ specification_version: 4
340
+ summary: The acts_as_paranoid for content moderation - automatic flagging system for
341
+ Rails
342
+ test_files: []