Comments (4)
Not currently, however it would not be terribly complex to make this a configurable option as has been done with other similar gems (see how I added configurable column names to flag_shih_tzu). I won't have time to do it real soon though. I did recently add the ability to configure the names of the relationships (e.g. :votes_on, :votes_by) and this can be accomplished in similar fashion.
Pull requests welcome!
from thumbs_up.
Thanks for the reply. I've forked and have been working on a PR already. 😉 You'll get it sooner or later.
from thumbs_up.
Went to write tests and they don't work. Seems the tests are dropping the database the recreating it. However I don't think this works. And yes, I entered the mysql commands verbatim from the README
.
$ ~> rake DB=mysql
/Users/suki/.rvm/rubies/ruby-1.9.3-p392/bin/ruby -I"lib:lib:test" -I"/Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib" "/Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/rake_test_loader.rb" "test/thumbs_up_test.rb"
Coverage report generated for Unit Tests to /Users/suki/source/thumbs_up/coverage. 0 / 0 LOC (0.0%) covered.
/Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:286:in `query': Mysql2::Error: Access denied for user 'test'@'localhost' to database 'thumbs_up_test': CREATE DATABASE `thumbs_up_test` DEFAULT CHARACTER SET `utf8` (ActiveRecord::StatementInvalid)
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:286:in `block in execute'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:425:in `block in log'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:420:in `log'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:286:in `execute'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-4.0.0/lib/active_record/connection_adapters/mysql2_adapter.rb:220:in `execute'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:383:in `create_database'
from /Users/suki/source/thumbs_up/test/test_helper.rb:33:in `<top (required)>'
from /Users/suki/source/thumbs_up/test/thumbs_up_test.rb:1:in `require'
from /Users/suki/source/thumbs_up/test/thumbs_up_test.rb:1:in `<top (required)>'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/rake_test_loader.rb:15:in `require'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/rake_test_loader.rb:15:in `block in <main>'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/rake_test_loader.rb:4:in `select'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!
Command failed with status (1): [ruby -I"lib:lib:test" -I"/Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib" "/Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/rake_test_loader.rb" "test/thumbs_up_test.rb" ]
/Users/suki/source/thumbs_up/Rakefile:36:in `block in <top (required)>'
/Users/suki/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/Users/suki/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => default => test_all_databases
(See full trace by running task with --trace)
$ ~> mysql -v
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.6.13 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Reading history-file /Users/suki/.mysql_history
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
from thumbs_up.
You have a permission error in MySQL. Please grant privileges as specified in the README.
On Sep 12, 2013, at 4:04 PM, Devin Weaver [email protected] wrote:
Went to write tests and they don't work. Seems the tests are dropping the database the recreating it. However I don't think this works.
$ ~> rake DB=mysql
'
/Users/suki/.rvm/rubies/ruby-1.9.3-p392/bin/ruby -I"lib:lib:test" -I"/Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib" "/Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/rake_test_loader.rb" "test/thumbs_up_test.rb"
Coverage report generated for Unit Tests to /Users/suki/source/thumbs_up/coverage. 0 / 0 LOC (0.0%) covered.
/Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:286:inquery': Mysql2::Error: Access denied for user 'test'@'localhost' to database 'thumbs_up_test': CREATE DATABASE
thumbs_up_testDEFAULT CHARACTER SET
utf8(ActiveRecord::StatementInvalid) from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:286:in
block in execute'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:425:inblock in log' from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0/lib/active_support/notifications/instrumenter.rb:20:in
instrument'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:420:inlog' from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:286:in
execute'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-4.0.0/lib/active_record/connection_adapters/mysql2_adapter.rb:220:inexecute' from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:383:in
create_database'
from /Users/suki/source/thumbs_up/test/test_helper.rb:33:in<top (required)>' from /Users/suki/source/thumbs_up/test/thumbs_up_test.rb:1:in
require'
from /Users/suki/source/thumbs_up/test/thumbs_up_test.rb:1:in<top (required)>' from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/rake_test_loader.rb:15:in
require'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/rake_test_loader.rb:15:inblock in <main>' from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/rake_test_loader.rb:4:in
select'
from /Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/rake_test_loader.rb:4:in<main>' rake aborted! Command failed with status (1): [ruby -I"lib:lib:test" -I"/Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib" "/Users/suki/.rvm/gems/ruby-1.9.3-p392/gems/rake-10.1.0/lib/rake/rake_test_loader.rb" "test/thumbs_up_test.rb" ] /Users/suki/source/thumbs_up/Rakefile:36:in
block in <top (required)>'
/Users/suki/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:ineval' /Users/suki/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in
Tasks: TOP => default => test_all_databases
(See full trace by running task with --trace)$ ~> mysql -v
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.6.13 Source distributionCopyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Reading history-file /Users/suki/.mysql_history
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
—
Reply to this email directly or view it on GitHub.
from thumbs_up.
Related Issues (20)
- Rails 4.2 support? HOT 1
- plusminus_tally broken in Postgres with recent Arel
- Rails 5 support HOT 1
- Votes count different? HOT 1
- tally broken HOT 1
- karma for has_many association
- Check if user voted for x items HOT 5
- Calculating total karma for a user HOT 3
- NoMethodError (undefined method `vote_exclusively_for' for :false:Symbol): HOT 2
- how can i use it with mongodb?
- Needs voteable.voters_who_voted_for and voteable.voters_who_voted_against HOT 3
- Show all the posts that a user has liked (voted_on) in user's profile HOT 9
- Using in rake task HOT 11
- Using thumbs_up while iterating in view.
- Work with mongoid?
- Starting with more Karma HOT 1
- wrong number of arguments (3 for 0) (ArgumentError) HOT 8
- How would I add another piece of data to the vote? HOT 1
- List of records a user has voted for HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thumbs_up.