{"id":22027140,"url":"https://github.com/brianp/dm-is-voteable","last_synced_at":"2025-10-14T08:06:22.737Z","repository":{"id":56844279,"uuid":"959343","full_name":"brianp/dm-is-voteable","owner":"brianp","description":"A DataMapper voting gem","archived":false,"fork":false,"pushed_at":"2013-09-26T06:28:16.000Z","size":221,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-07T15:57:55.940Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-10-03T23:33:21.000Z","updated_at":"2020-06-16T08:54:04.000Z","dependencies_parsed_at":"2022-09-09T04:11:22.307Z","dependency_job_id":null,"html_url":"https://github.com/brianp/dm-is-voteable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brianp/dm-is-voteable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianp%2Fdm-is-voteable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianp%2Fdm-is-voteable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianp%2Fdm-is-voteable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianp%2Fdm-is-voteable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianp","download_url":"https://codeload.github.com/brianp/dm-is-voteable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianp%2Fdm-is-voteable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014640,"owners_count":26085556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-30T07:35:33.305Z","updated_at":"2025-10-14T08:06:22.708Z","avatar_url":"https://github.com/brianp.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dm-is-voteable\n[![Build\nStatus](https://travis-ci.org/brianp/dm-is-voteable.png?branch=master)](https://travis-ci.org/brianp/dm-is-voteable)\n[![Code\nClimate](https://codeclimate.com/github/brianp/dm-is-voteable.png)](https://codeclimate.com/github/brianp/dm-is-voteable)\n\nA DataMapper compatible voting gem. Can track votes by identifier so a user may only submit a single vote.\n\n## Requirments\n* Ruby 1.9\n\n## Installation\nTo install as a gem add the following line to your gem file.\n`gem 'dm-is-voteable'`\n\nThen:\n`bundle install`\n\nAnd build the required DB tables:\n`rake db:auto_update`\n \n## Example\n\nAdd `is_voteable` To any model and gain the power of the vote method.\n\n```ruby\nclass Movie\n  include DataMapper::Resource\n\n  property :id, Serial\n  property :title, String, required: true\n  \n  is_voteable\nend\n```\n\nVote for the Model by calling `model.vote`\n\n## Voting Restrictions\n\nAllow only a single vote per user within a certain time frame by setting a time frame in the model:\n\n```ruby\nclass Movie\n  include DataMapper::Resource\n\n  property :id, Serial\n  property :title, String, required: true\n  \n  is_voteable(last_vote_time: -\u003e{ 3.days.ago })\nend\n```\n\nThen send an identifier along with the vote:\n\n```ruby\nuser_ip = request.env['REMOTE_ADDR']\nmodel.vote(user_ip)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianp%2Fdm-is-voteable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianp%2Fdm-is-voteable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianp%2Fdm-is-voteable/lists"}