Coder Social home page Coder Social logo

Comments (4)

pboling avatar pboling commented on August 16, 2024

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.

sukima avatar sukima commented on August 16, 2024

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.

sukima avatar sukima commented on August 16, 2024

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.

bouchard avatar bouchard commented on August 16, 2024

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:in query': Mysql2::Error: Access denied for user 'test'@'localhost' to database 'thumbs_up_test': CREATE DATABASEthumbs_up_testDEFAULT CHARACTER SETutf8(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:inblock 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:ininstrument'
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:inexecute'
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:increate_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:inrequire'
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:inrequire'
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:inselect'
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:inblock 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

'
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.

Reply to this email directly or view it on GitHub.

from thumbs_up.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.