voteable_ceconcepcion 0.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 (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/voteable_ceconcepcion.rb +21 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8db3023e604470ada5514bac2b0b6200fa12de2e
4
+ data.tar.gz: db20e92db2b2dc008f688179bfc95cc14f434316
5
+ SHA512:
6
+ metadata.gz: 50f1c09ce4aecadf0985fd9e748537db41ae42e36505eeb2ff105d677248d1ff52b4cc7c2eaf310f71a59450d54f1bce93de4df548865be6ca992c905786329e
7
+ data.tar.gz: 4d612f940a3a5437396d7d94c40a49286db91b4200388f23654ef5a1b95df65041cca5e2592f0e3d602a1bebc56dd83efcd05da446161d6011506b668c958bf8
@@ -0,0 +1,21 @@
1
+ module Voteable_Ceconcepcion
2
+
3
+ def base.included(base)
4
+ base.send(:include, InstanceMethods)
5
+ base.extend ClassMethods
6
+ base.class_eval do
7
+ class_method_name
8
+
9
+ module InstanceMethods
10
+ def total_votes
11
+ self.votes.where(vote: true).size - self.votes.where(vote: false).size
12
+ end
13
+ end
14
+
15
+ module ClassMethods
16
+ def associations_for_votes
17
+ has_many :votes, as: :voteable
18
+ end
19
+ end
20
+
21
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: voteable_ceconcepcion
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Christopher Concepcion
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-06-29 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: This gem checks total votes with a instance variable that is using a
14
+ polymorphic votes
15
+ email: feverdoingwork@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/voteable_ceconcepcion.rb
21
+ homepage: http://www.github.com/feverdoingwork/
22
+ licenses: []
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.0.3
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: A voting gem
44
+ test_files: []