bannable 0.1.1 → 0.1.2

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: 3046cbc7ae391a11b60147d3f6c65d317622a08b
4
- data.tar.gz: af0338738f31a939614d4e0ad24c811de3f9b26e
3
+ metadata.gz: 9f3a1a4db883a3d8e841f6d34ee09256a84bf931
4
+ data.tar.gz: c10aadac3cac88c148f171032da8673b1ca1e300
5
5
  SHA512:
6
- metadata.gz: 570b9d1a43e2f7e9a82789513fb46ba68de7f833467e262a99bfbf0119c7757a18b3050b924a847fef5bba12dfd29f19dc594fc1393c71a44649e73d704995c8
7
- data.tar.gz: ce92e1772ca2788ed5cd8c0b4cfceb97c5e7465bc8293f6e1832364d95e48f7616b02b460f1cefea7114752748b82bbaa3e06713060358af8a8f50ab881842b1
6
+ metadata.gz: ec8e99692dea63ea321b1ba35892fbdbecfbff33f274c78878151a91d1b284fcf12c192fa36e9fefb745067be5abfe1ba9c422e2b6d1f495a1e8bcef30942736
7
+ data.tar.gz: 092d9978fb7eab47a2723d34bfa61dfefd696d637a9509b24e9d4bf3dbcf73f41ec51937d23cb8fdf81f4868bf242f454b40a1e06b193f048d5f390a3c749536
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Bannable
2
- Allow models to be bannable in Rails.
2
+ Allow models to be bannable in Rails. Designed to work like the [hideable](https://github.com/joecorcoran/hideable) gem.
3
+
4
+ [![Build Status](https://travis-ci.org/notrab/bannable.svg)](https://travis-ci.org/notrab/bannable)
3
5
 
4
6
  ## Installation
5
7
 
@@ -17,7 +19,21 @@ Or install it yourself as:
17
19
 
18
20
  ## Usage
19
21
 
20
- Add `bannable` to models you wish to be bannable.
22
+ Add the following to your models you wish to be bannable
23
+
24
+ extend Bannable::ActiveRecord
25
+ bannable
26
+
27
+ Something like...
28
+
29
+ ```ruby
30
+ class User
31
+ extend Bannable::ActiveRecord
32
+ bannable
33
+ end
34
+ ```
35
+
36
+ You'll then need to run `rails generate bannable:migration Model`. Replacing `Model` with an array of the `Bannable` models.
21
37
 
22
38
  ## Contributing
23
39
 
data/bannable.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Jamie Barton"]
10
10
  spec.email = ["jamie@codethisway.com"]
11
11
  spec.summary = %q{Ban your ActiveRecord models}
12
- spec.description = %q{Easily set models as banned}
12
+ spec.description = %q{Easily set ActiveRecord models as banned. Designed to work like the hideable gem.}
13
13
  spec.homepage = "http://github.com/notrab/bannable"
14
14
  spec.license = "MIT"
15
15
 
@@ -12,10 +12,6 @@ module Bannable
12
12
  self.banned = nil
13
13
  self.save!
14
14
  end
15
-
16
- def banned?
17
- self.banned?
18
- end
19
15
  end
20
16
  end
21
17
  end
@@ -1,6 +1,6 @@
1
1
  module Bannable
2
2
  module ActiveRecord
3
- def bannable(options = {})
3
+ def bannable
4
4
  send :include, InstanceMethods
5
5
  end
6
6
 
@@ -1,3 +1,3 @@
1
1
  module Bannable
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/bannable.rb CHANGED
@@ -1,3 +1,3 @@
1
+ require "bannable/version"
1
2
  require 'bannable/active_record'
2
3
  require 'bannable/active_record/instance_methods'
3
- require "bannable/version"
data/travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bannable
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
  - Jamie Barton
@@ -38,7 +38,8 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: Easily set models as banned
41
+ description: Easily set ActiveRecord models as banned. Designed to work like the hideable
42
+ gem.
42
43
  email:
43
44
  - jamie@codethisway.com
44
45
  executables: []
@@ -56,6 +57,7 @@ files:
56
57
  - lib/bannable/active_record/instance_methods.rb
57
58
  - lib/bannable/version.rb
58
59
  - lib/generators/bannable/migration_generator.rb
60
+ - travis.yml
59
61
  homepage: http://github.com/notrab/bannable
60
62
  licenses:
61
63
  - MIT