the_moderator 0.1.1 → 0.1.2

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: 55799be13b867400ecedb7640347f5f00ace2465
4
- data.tar.gz: 5db592b670f29749b6c2d405c94976cecf5c8bdb
3
+ metadata.gz: c787c1c3e6f7025ead3692dba90fc55e1b4e38ee
4
+ data.tar.gz: eafd6e898c538d2c482198f91d84ddce105781c1
5
5
  SHA512:
6
- metadata.gz: 56fc8b648f6f02549c5037dd2481e680234c9c308f465c03321ade6c00298412940cc935c90f8c6dc24fda2b58ebe2784e85df249c410189c9e27c362fdf617e
7
- data.tar.gz: decc32e5617fdd3a1bd6266cc3eb97bc63c77800432b0549ecdc2db53b4c1433af18c54c0970781429fbf756670fd58d49461f08bd8ccf76dd6bd7aa71957c96
6
+ metadata.gz: 4da06fc770cf6c60d15a4ef709297a6269dff7368581e9e0a76b4e2380282d11903581508b2debc2c22cf7f387e5662ca3b68a1bb7042f24891e472973a47433
7
+ data.tar.gz: 50b95087c21e282ff295490804bf4dd14d86cfceba4bd96f63bd2d484978f569b59bb3ad8457e9bab80ed9bc6bafd5439f3cb050da5107d0a7509d771773d1aa
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.1
6
+ - rbx-2
7
+ script: 'bundle exec rspec spec'
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # TheModerator
2
2
 
3
+ [![Build Status](https://travis-ci.org/gdott9/the_moderator.svg?branch=master)](https://travis-ci.org/gdott9/the_moderator)
4
+
3
5
  Moderate fields before their insertion in the database by serializing and saving them into a separate 'moderations' table.
4
6
 
5
7
  ## Installation
@@ -1,3 +1,3 @@
1
1
  module TheModerator
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -6,7 +6,7 @@ describe TheModerator::Model do
6
6
  page = Page.new(name: 'Name', content: 'Content')
7
7
  page.moderate(:name)
8
8
 
9
- expect(page.moderations).to have(1).moderation
9
+ expect(page.moderations.size).to eq(1)
10
10
  expect(page.moderations.first.data[:attributes]).to include(name: 'Name')
11
11
  expect(page.name).to be_nil
12
12
  expect(page.content).to eq('Content')
@@ -21,7 +21,7 @@ describe TheModerator::Model do
21
21
  name: 'name', content: 'content', id: category.page.id}}
22
22
  category.moderate(page: :name)
23
23
 
24
- expect(category.moderations).to have(1).moderation
24
+ expect(category.moderations.size).to eq(1)
25
25
  expect(category.moderations.first.data[:attributes])
26
26
  .to include(page_attributes: {name: 'name', id: category.page.id})
27
27
  expect(category.page.name).to be_nil
@@ -35,7 +35,7 @@ describe TheModerator::Model do
35
35
  page.attributes = {links_attributes: [{id: link.id, name: 'link'}]}
36
36
  page.moderate(links: [:name])
37
37
 
38
- expect(page.moderations).to have(1).moderation
38
+ expect(page.moderations.size).to eq(1)
39
39
  expect(page.moderations.first.data[:attributes])
40
40
  .to include(links_attributes: {link.id => {name: 'link', id: link.id}})
41
41
  expect(link.name).to be_nil
@@ -47,8 +47,8 @@ describe TheModerator::Model do
47
47
  page = Page.new(name: 'Name', content: 'Content')
48
48
  page.moderate(:name)
49
49
 
50
- expect(page.moderated?(:name)).to be_true
51
- expect(page.moderated?(:content)).to be_false
50
+ expect(page.moderated?(:name)).to be true
51
+ expect(page.moderated?(:content)).to be false
52
52
  end
53
53
  end
54
54
  end
@@ -15,7 +15,7 @@ describe TheModerator::ModerationModel do
15
15
  subject.accept
16
16
 
17
17
  expect(subject.moderatable.name).to eq('Name')
18
- expect(subject.destroyed?).to be_true
18
+ expect(subject.destroyed?).to be true
19
19
  end
20
20
  end
21
21
 
@@ -25,7 +25,7 @@ describe TheModerator::ModerationModel do
25
25
  subject.discard
26
26
 
27
27
  expect(subject.moderatable.name).to be_nil
28
- expect(subject.destroyed?).to be_true
28
+ expect(subject.destroyed?).to be true
29
29
  end
30
30
  end
31
31
 
@@ -34,15 +34,15 @@ describe TheModerator::ModerationModel do
34
34
  expect(subject.moderatable.name).to be_nil
35
35
  preview = subject.preview
36
36
 
37
- expect(preview.frozen?).to be_true
37
+ expect(preview.frozen?).to be true
38
38
  expect(preview.name).to eq('Name')
39
39
  end
40
40
  end
41
41
 
42
42
  describe '#include?' do
43
43
  it 'includes name' do
44
- expect(subject.include?(:name)).to be_true
45
- expect(subject.include?(:content)).to be_false
44
+ expect(subject.include?(:name)).to be true
45
+ expect(subject.include?(:content)).to be false
46
46
  end
47
47
  end
48
48
  end
@@ -18,9 +18,9 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
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"
21
+ spec.add_dependency "activemodel", ">= 3.2.0", "< 5.2"
22
+ spec.add_dependency "activerecord", ">= 3.2.0", "< 5.2"
23
+ spec.add_dependency "activesupport", ">= 3.2.0", "< 5.2"
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.3"
26
26
  spec.add_development_dependency "rake", "~> 10.3"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: the_moderator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume DOTT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-23 00:00:00.000000000 Z
11
+ date: 2017-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 3.2.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5.0'
22
+ version: '5.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 3.2.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5.0'
32
+ version: '5.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activerecord
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: 3.2.0
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '5.0'
42
+ version: '5.2'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: 3.2.0
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '5.0'
52
+ version: '5.2'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: activesupport
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  version: 3.2.0
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
- version: '5.0'
62
+ version: '5.2'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
@@ -69,7 +69,7 @@ dependencies:
69
69
  version: 3.2.0
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
- version: '5.0'
72
+ version: '5.2'
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: bundler
75
75
  requirement: !ruby/object:Gem::Requirement
@@ -149,6 +149,7 @@ extra_rdoc_files: []
149
149
  files:
150
150
  - ".gitignore"
151
151
  - ".rspec"
152
+ - ".travis.yml"
152
153
  - Gemfile
153
154
  - LICENSE.txt
154
155
  - README.md
@@ -194,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
195
  version: '0'
195
196
  requirements: []
196
197
  rubyforge_project:
197
- rubygems_version: 2.2.2
198
+ rubygems_version: 2.6.13
198
199
  signing_key:
199
200
  specification_version: 4
200
201
  summary: Moderate fields before their insertion in the database by serializing and