the_moderator 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 421b8e05b09df91ed6b0563933587edf3f07e5b4
4
+ data.tar.gz: 203d3f693d580c47b1868dd435eaf3247d0c11e5
5
+ SHA512:
6
+ metadata.gz: f70f543eab96bce0a9449022f5e21a99bed5da5146e8fd6c5888989e03082e2cde39792f5827de4f6b7e21260aa910e33b88d81e0ad9f165337ea765f68a07cb
7
+ data.tar.gz: db57bac199438ac4f4f6b77144b7fed879de8975023492ab3d0c8ee8fda49c0e326fef62d3d82eee6e594f6d3e2f5988e42e3253a9caec62830270d04b69a925
data/.gitignore ADDED
@@ -0,0 +1,19 @@
1
+ *.gem
2
+ *.rbc
3
+ *.sqlite
4
+ .bundle
5
+ .config
6
+ .yardoc
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
19
+ *.s[a-w][a-z]
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in the_moderator.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Guillaume DOTT
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # TheModerator
2
+
3
+ Moderate fields before their insertion in the database by serializing and saving them into a separate 'moderations' table.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'the_moderator'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install the_moderator
18
+
19
+ Then use the generator for the migration and the basic `Moderation` model:
20
+
21
+ $ rails generate the_moderator:install
22
+
23
+ ## Usage
24
+
25
+ To use `TheModerator`, you need to include `TheModerator::Model` in the models you want to moderate.
26
+
27
+ ```ruby
28
+ class Article
29
+ include TheModerator::Model
30
+ end
31
+ ```
32
+
33
+ The `Moderation` model added by the genenrator is used to access the moderations.
34
+
35
+ ### Moderate attributes
36
+
37
+ This gem adds 3 methods to your models.
38
+
39
+ - `moderate`
40
+ - `moderated?`
41
+ - `moderated_fields_for(assoc)`
42
+
43
+ ### Manage moderations
44
+
45
+ To list pending moderations, you can use the `Moderation` model
46
+
47
+ ```ruby
48
+ Moderation.all
49
+ ```
50
+
51
+ You can access the moderations for a specific object with
52
+
53
+ ```ruby
54
+ post = Post.last
55
+ post.moderations
56
+ ```
57
+
58
+ A `Moderation` instance has 4 methods:
59
+ - `moderation.data` returns a hash of the moderated attributes
60
+ - `moderation.data_display` returns a user-friendly hash to display the moderated attributes
61
+ - `moderation.preview`
62
+ - `moderation.accept` modifies the moderated object with the specified attributes and saves it
63
+ - `moderation.discard` destroys the moderation
64
+
65
+ ## Contributing
66
+
67
+ 1. Fork it
68
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
69
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
70
+ 4. Push to the branch (`git push origin my-new-feature`)
71
+ 5. Create new Pull Request
72
+
73
+ ## License
74
+
75
+ TheModerator is released under AGPLv3 license. Copyright (c) 2013 La Fourmi Immo
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Explain the generator
3
+
4
+ Example:
5
+ rails generate install Thing
6
+
7
+ This will create:
8
+ what/will/it/create
@@ -0,0 +1,18 @@
1
+ class TheModerator::InstallGenerator < Rails::Generators::Base
2
+ include Rails::Generators::Migration
3
+
4
+ source_root File.expand_path('../templates', __FILE__)
5
+
6
+ def copy_model
7
+ template 'moderation.rb', File.join('app', 'models', 'moderation.rb')
8
+ end
9
+
10
+ def create_migration_file
11
+ migration_template 'migration.rb', 'db/migrate/create_moderations.rb'
12
+ end
13
+
14
+ def self.next_migration_number(dirname)
15
+ ActiveRecord::Migration.next_migration_number(
16
+ current_migration_number(dirname) + 1)
17
+ end
18
+ end
@@ -0,0 +1,15 @@
1
+ class CreateModerations < ActiveRecord::Migration
2
+ def self.up
3
+ create_table "moderations" do |t|
4
+ t.references :moderatable, polymorphic: true
5
+ t.text :data, :null => false
6
+ t.text :data_display, :null => false
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ drop_table :moderations
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ class Moderation < ActiveRecord::Base
2
+ include TheModerator::ModerationModel
3
+ end
@@ -0,0 +1,4 @@
1
+ module TheModerator
2
+ class ModerationNotAccepted < StandardError
3
+ end
4
+ end
@@ -0,0 +1,99 @@
1
+ require 'active_support/concern'
2
+
3
+ module TheModerator
4
+ module Model
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ has_many :moderations, as: :moderatable, dependent: :destroy
9
+ end
10
+
11
+ module ClassMethods
12
+ end
13
+
14
+ def moderate(*moderated_attributes)
15
+ data = moderation_data(*moderated_attributes)
16
+ moderations.build(data: {attributes: data[:data]},
17
+ data_display: data[:data_display]) unless data[:data].empty?
18
+ end
19
+
20
+ def moderated?(attr_name)
21
+ moderations.each do |moderation|
22
+ return true if moderation.include?(attr_name)
23
+ end
24
+ false
25
+ end
26
+
27
+ def moderated_fields_for(assoc)
28
+ moderations.map { |m| m.moderated_fields_for(assoc) }
29
+ .inject(&:|)
30
+ end
31
+
32
+ protected
33
+
34
+ def moderation_data(*moderated_attributes)
35
+ moderate_object moderated_attributes
36
+ end
37
+
38
+ private
39
+
40
+ def moderate_object(moderated_attributes)
41
+ object_fields, object_fields_display = {}, {}
42
+
43
+ moderated_attributes.each do |attribute|
44
+ if attribute.is_a?(Hash)
45
+ attribute.each do |key, value|
46
+ data = moderate_association(key, value)
47
+ object_fields[:"#{key}_attributes"] = data[:data] unless data[:data].empty?
48
+ object_fields_display.merge!(data[:data_display]) unless data[:data_display].empty?
49
+ end
50
+ elsif changed.include?(attribute.to_s)
51
+ object_fields[attribute.to_sym] = send(attribute)
52
+ class_name ||= self.class.name.to_sym
53
+ object_fields_display[class_name] ||= {}
54
+ object_fields_display[class_name].merge!(attribute.to_sym => send(attribute))
55
+ send("#{attribute}=", changed_attributes[attribute.to_s])
56
+ end
57
+ end
58
+
59
+ { data: object_fields, data_display: object_fields_display }
60
+ end
61
+
62
+ def moderate_association(assoc, moderated_attributes)
63
+ assoc_fields, assoc_fields_display = {}, {}
64
+ objects = send(assoc)
65
+
66
+ if respond_to?("#{assoc}_attributes=")
67
+ if objects.is_a?(Array)
68
+ data = moderate_has_many_association(objects, moderated_attributes)
69
+ assoc_fields = data[:data]
70
+ assoc_fields_display = data[:data_display]
71
+ else
72
+ data = objects.moderation_data(*moderated_attributes)
73
+ assoc_fields = data[:data].merge(id: objects.id) unless data[:data].empty?
74
+ assoc_fields_display = data[:data_display] unless data[:data_display].empty?
75
+ end
76
+ end
77
+
78
+ { data: assoc_fields, data_display: assoc_fields_display }
79
+ end
80
+
81
+ def moderate_has_many_association(objects, moderated_attributes)
82
+ assoc_fields, assoc_fields_display = {}, {}
83
+ tab = []
84
+
85
+ objects.each do |resource|
86
+ data = resource.moderation_data(*moderated_attributes)
87
+
88
+ assoc_fields[resource.id] = data[:data].merge(id: resource.id) unless data[:data].empty?
89
+ unless data[:data_display].empty?
90
+ key = data[:data_display].keys.first
91
+ assoc_fields_display[key] ||= {}
92
+ assoc_fields_display[key] = tab.push(data[:data])
93
+ end
94
+ end
95
+
96
+ { data: assoc_fields, data_display: assoc_fields_display }
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,69 @@
1
+ require 'active_support/concern'
2
+
3
+ module TheModerator
4
+ module ModerationModel
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ belongs_to :moderatable, polymorphic: true
9
+ serialize :data
10
+ serialize :data_display
11
+ end
12
+
13
+ module ClassMethods
14
+ end
15
+
16
+ def accept
17
+ self.class.transaction do
18
+ destroy
19
+ moderatable.update_attributes(data)
20
+ end
21
+ end
22
+
23
+ def accept!
24
+ accept || raise(TheModerator::ModerationNotAccepted)
25
+ end
26
+
27
+ def discard
28
+ destroy
29
+ end
30
+
31
+ def preview
32
+ preview = moderatable.clone
33
+ preview.attributes = data
34
+ preview.freeze
35
+ end
36
+
37
+ def parsed_data
38
+ data
39
+ end
40
+
41
+ def parsed_data_display
42
+ data_display
43
+ end
44
+
45
+ def include?(attribute)
46
+ include_attribute?(attribute, data[:attributes])
47
+ end
48
+
49
+ def moderated_fields_for(assoc)
50
+ (data[:attributes][assoc].try(:keys) || []) - [:id]
51
+ end
52
+
53
+ private
54
+
55
+ def include_attribute?(attribute, attr_data)
56
+ return false if attr_data.nil?
57
+ if attribute.is_a?(Hash)
58
+ include_assoc?(attribute, attr_data)
59
+ else
60
+ attr_data.keys.include?(attribute)
61
+ end
62
+ end
63
+
64
+ def include_assoc?(attribute, assoc_data)
65
+ include_attribute?(attribute.first.last,
66
+ assoc_data[attribute.first.first])
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,3 @@
1
+ module TheModerator
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,4 @@
1
+ require 'the_moderator/version'
2
+ require 'the_moderator/exceptions'
3
+ require 'the_moderator/model'
4
+ require 'the_moderator/moderation_model'
@@ -0,0 +1,6 @@
1
+ class Category < ActiveRecord::Base
2
+ include TheModerator::Model
3
+
4
+ has_one :page
5
+ accepts_nested_attributes_for :page
6
+ end
@@ -0,0 +1,3 @@
1
+ class Link < ActiveRecord::Base
2
+ belongs_to :page
3
+ end
@@ -0,0 +1,3 @@
1
+ class Moderation < ActiveRecord::Base
2
+ include TheModerator::ModerationModel
3
+ end
@@ -0,0 +1,8 @@
1
+ class Page < ActiveRecord::Base
2
+ include TheModerator::Model
3
+
4
+ has_many :links
5
+ accepts_nested_attributes_for :links
6
+
7
+ belongs_to :category
8
+ end
@@ -0,0 +1,3 @@
1
+ test:
2
+ adapter: sqlite3
3
+ database: db/combustion_test.sqlite
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ #
3
+ end
@@ -0,0 +1,28 @@
1
+ ActiveRecord::Schema.define do
2
+ create_table :categories, :force => true do |t|
3
+ t.string :name
4
+ t.timestamps
5
+ end
6
+
7
+ create_table :pages, :force => true do |t|
8
+ t.integer :category_id
9
+ t.string :name
10
+ t.text :content
11
+ t.timestamps
12
+ end
13
+
14
+ create_table :links, :force => true do |t|
15
+ t.integer :page_id
16
+ t.string :name
17
+ t.string :url
18
+ t.timestamps
19
+ end
20
+
21
+ create_table :moderations, :force => true do |t|
22
+ t.integer :moderatable_id
23
+ t.string :moderatable_type
24
+ t.text :data
25
+ t.text :data_display
26
+ t.timestamps
27
+ end
28
+ end
@@ -0,0 +1 @@
1
+ *.log
@@ -0,0 +1,14 @@
1
+ require 'bundler/setup'
2
+ require 'combustion'
3
+
4
+ require 'the_moderator'
5
+
6
+ Combustion.initialize! :active_record, :active_model
7
+
8
+ RSpec.configure do |config|
9
+ config.treat_symbols_as_metadata_keys_with_true_values = true
10
+ config.run_all_when_everything_filtered = true
11
+ config.filter_run :focus
12
+
13
+ config.order = 'random'
14
+ end
@@ -0,0 +1,40 @@
1
+ require 'spec_helper'
2
+
3
+ describe TheModerator::Model do
4
+ describe '#moderate' do
5
+ it 'moderates simple field' do
6
+ page = Page.new(name: 'Name', content: 'Content')
7
+ page.moderate(:name)
8
+
9
+ expect(page.moderations).to have(1).moderation
10
+ expect(page.moderations.first.data[:attributes]).to include(name: 'Name')
11
+ expect(page.name).to be_nil
12
+ expect(page.content).to eq('Content')
13
+ end
14
+
15
+ it 'moderates association fields' do
16
+ category = Category.new(name: 'category')
17
+ category.create_page
18
+ category.save
19
+
20
+ category.attributes = {page_attributes: {
21
+ name: 'name', content: 'content', id: category.page.id}}
22
+ category.moderate(page: :name)
23
+
24
+ expect(category.moderations).to have(1).moderation
25
+ expect(category.moderations.first.data[:attributes])
26
+ .to include(page_attributes: {name: 'name', id: category.page.id})
27
+ expect(category.page.name).to be_nil
28
+ end
29
+ end
30
+
31
+ describe '#moderated?' do
32
+ it 'detects moderated field' do
33
+ page = Page.new(name: 'Name', content: 'Content')
34
+ page.moderate(:name)
35
+
36
+ expect(page.moderated?(:name)).to be_true
37
+ expect(page.moderated?(:content)).to be_false
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,48 @@
1
+ require 'spec_helper'
2
+
3
+ describe TheModerator::ModerationModel do
4
+ subject do
5
+ page = Page.new(name: 'Name', content: 'Content')
6
+ moderation = page.moderate(:name)
7
+ page.save
8
+
9
+ moderation
10
+ end
11
+
12
+ describe '#accept' do
13
+ it 'accepts moderated data' do
14
+ expect(subject.moderatable.name).to be_nil
15
+ subject.accept
16
+
17
+ expect(subject.moderatable.name).to eq('Name')
18
+ expect(subject.destroyed?).to be_true
19
+ end
20
+ end
21
+
22
+ describe '#discard' do
23
+ it 'discards moderated data' do
24
+ expect(subject.moderatable.name).to be_nil
25
+ subject.discard
26
+
27
+ expect(subject.moderatable.name).to be_nil
28
+ expect(subject.destroyed?).to be_true
29
+ end
30
+ end
31
+
32
+ describe '#preview' do
33
+ it 'previews moderated data' do
34
+ expect(subject.moderatable.name).to be_nil
35
+ preview = subject.preview
36
+
37
+ expect(preview.frozen?).to be_true
38
+ expect(preview.name).to eq('Name')
39
+ end
40
+ end
41
+
42
+ describe '#include?' do
43
+ it 'includes name' do
44
+ expect(subject.include?(:name)).to be_true
45
+ expect(subject.include?(:content)).to be_false
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'the_moderator/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "the_moderator"
8
+ spec.version = TheModerator::VERSION
9
+ spec.authors = ["Guillaume DOTT"]
10
+ spec.email = ["guillaume+github@dott.fr"]
11
+ spec.description = %q{Moderate fields of a model or its associations}
12
+ spec.summary = %q{Moderate fields before their insertion in the database by serializing and saving them into a separate 'moderations' table.}
13
+ spec.homepage = "https://github.com/gdott9/the_moderator"
14
+ spec.license = "AGPL"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "activemodel", ">= 3.2.0", "< 5.0"
22
+ spec.add_dependency "activerecord", ">= 3.2.0", "< 5.0"
23
+ spec.add_dependency "activesupport", ">= 3.2.0", "< 5.0"
24
+
25
+ spec.add_development_dependency "bundler", "~> 1.3"
26
+ spec.add_development_dependency "rake", "~> 10.3"
27
+
28
+ spec.add_development_dependency "rspec", "~> 2.14"
29
+ spec.add_development_dependency "combustion", "~> 0.5"
30
+ spec.add_development_dependency "sqlite3", "~> 1.3"
31
+ end
metadata ADDED
@@ -0,0 +1,213 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: the_moderator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Guillaume DOTT
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-08-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activemodel
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.2.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 3.2.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: activerecord
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 3.2.0
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '5.0'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 3.2.0
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '5.0'
53
+ - !ruby/object:Gem::Dependency
54
+ name: activesupport
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 3.2.0
60
+ - - "<"
61
+ - !ruby/object:Gem::Version
62
+ version: '5.0'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 3.2.0
70
+ - - "<"
71
+ - !ruby/object:Gem::Version
72
+ version: '5.0'
73
+ - !ruby/object:Gem::Dependency
74
+ name: bundler
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '1.3'
80
+ type: :development
81
+ prerelease: false
82
+ version_requirements: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - "~>"
85
+ - !ruby/object:Gem::Version
86
+ version: '1.3'
87
+ - !ruby/object:Gem::Dependency
88
+ name: rake
89
+ requirement: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - "~>"
92
+ - !ruby/object:Gem::Version
93
+ version: '10.3'
94
+ type: :development
95
+ prerelease: false
96
+ version_requirements: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - "~>"
99
+ - !ruby/object:Gem::Version
100
+ version: '10.3'
101
+ - !ruby/object:Gem::Dependency
102
+ name: rspec
103
+ requirement: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - "~>"
106
+ - !ruby/object:Gem::Version
107
+ version: '2.14'
108
+ type: :development
109
+ prerelease: false
110
+ version_requirements: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - "~>"
113
+ - !ruby/object:Gem::Version
114
+ version: '2.14'
115
+ - !ruby/object:Gem::Dependency
116
+ name: combustion
117
+ requirement: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - "~>"
120
+ - !ruby/object:Gem::Version
121
+ version: '0.5'
122
+ type: :development
123
+ prerelease: false
124
+ version_requirements: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - "~>"
127
+ - !ruby/object:Gem::Version
128
+ version: '0.5'
129
+ - !ruby/object:Gem::Dependency
130
+ name: sqlite3
131
+ requirement: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - "~>"
134
+ - !ruby/object:Gem::Version
135
+ version: '1.3'
136
+ type: :development
137
+ prerelease: false
138
+ version_requirements: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - "~>"
141
+ - !ruby/object:Gem::Version
142
+ version: '1.3'
143
+ description: Moderate fields of a model or its associations
144
+ email:
145
+ - guillaume+github@dott.fr
146
+ executables: []
147
+ extensions: []
148
+ extra_rdoc_files: []
149
+ files:
150
+ - ".gitignore"
151
+ - ".rspec"
152
+ - Gemfile
153
+ - LICENSE.txt
154
+ - README.md
155
+ - Rakefile
156
+ - lib/generators/the_moderator/install/USAGE
157
+ - lib/generators/the_moderator/install/install_generator.rb
158
+ - lib/generators/the_moderator/install/templates/migration.rb
159
+ - lib/generators/the_moderator/install/templates/moderation.rb
160
+ - lib/the_moderator.rb
161
+ - lib/the_moderator/exceptions.rb
162
+ - lib/the_moderator/model.rb
163
+ - lib/the_moderator/moderation_model.rb
164
+ - lib/the_moderator/version.rb
165
+ - spec/internal/app/models/category.rb
166
+ - spec/internal/app/models/link.rb
167
+ - spec/internal/app/models/moderation.rb
168
+ - spec/internal/app/models/page.rb
169
+ - spec/internal/config/database.yml
170
+ - spec/internal/config/routes.rb
171
+ - spec/internal/db/schema.rb
172
+ - spec/internal/log/.gitignore
173
+ - spec/spec_helper.rb
174
+ - spec/the_moderator/model_spec.rb
175
+ - spec/the_moderator/moderation_model_spec.rb
176
+ - the_moderator.gemspec
177
+ homepage: https://github.com/gdott9/the_moderator
178
+ licenses:
179
+ - AGPL
180
+ metadata: {}
181
+ post_install_message:
182
+ rdoc_options: []
183
+ require_paths:
184
+ - lib
185
+ required_ruby_version: !ruby/object:Gem::Requirement
186
+ requirements:
187
+ - - ">="
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
190
+ required_rubygems_version: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ requirements: []
196
+ rubyforge_project:
197
+ rubygems_version: 2.4.1
198
+ signing_key:
199
+ specification_version: 4
200
+ summary: Moderate fields before their insertion in the database by serializing and
201
+ saving them into a separate 'moderations' table.
202
+ test_files:
203
+ - spec/internal/app/models/category.rb
204
+ - spec/internal/app/models/link.rb
205
+ - spec/internal/app/models/moderation.rb
206
+ - spec/internal/app/models/page.rb
207
+ - spec/internal/config/database.yml
208
+ - spec/internal/config/routes.rb
209
+ - spec/internal/db/schema.rb
210
+ - spec/internal/log/.gitignore
211
+ - spec/spec_helper.rb
212
+ - spec/the_moderator/model_spec.rb
213
+ - spec/the_moderator/moderation_model_spec.rb