voteable_rafaelb 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_rafaelb.rb +13 -0
  3. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4225847f870217ac98308cbc52e2c1773a8e7db1
4
+ data.tar.gz: d71105290a60c6b26c4ffc484c9175623d6a1c04
5
+ SHA512:
6
+ metadata.gz: a735f1466ba076e8d4df1c2ce49e3b025250fd0083a10677fa22fcdd73556f4de33c961e871b49e02b0790e35cadd50044606f6dac4bdcb272f04715f267a1ad
7
+ data.tar.gz: ae636311815655727f256c9415ed3084e47699803a78ce86b637e687c24d22ed146ef4e4df651ac5911381484ea3dd97795c819a3e288a553f0673bdb563b363
@@ -0,0 +1,13 @@
1
+ module Voteable
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ has_many :votes, as: :voteable
6
+ end
7
+
8
+ def rating
9
+ total = 0
10
+ self.votes.each {|v| total += v.value }
11
+ total
12
+ end
13
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: voteable_rafaelb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Rafael Borochov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-09 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Look up voting on wikipedia
14
+ email:
15
+ - rafael.borochov@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/voteable_rafaelb.rb
21
+ homepage: http://en.wikipedia.org/wiki/Voting
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.2.0
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: A voting gem
45
+ test_files: []