doc
parent
62a428549c
commit
52b4785161
10
README.md
10
README.md
|
@ -423,6 +423,16 @@ author.rate resource, 5, extra_scope: { approved: true }
|
||||||
|
|
||||||
As you can see, now, only the rate with value `5` will be included on the final rating.
|
As you can see, now, only the rate with value `5` will be included on the final rating.
|
||||||
|
|
||||||
|
### Specs
|
||||||
|
|
||||||
|
To run all specs, run the following rakes:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
bundle exec rake spec
|
||||||
|
bundle exec rake spec_config
|
||||||
|
bundle exec rake spec_config_with_extra_scopes
|
||||||
|
```
|
||||||
|
|
||||||
### References
|
### References
|
||||||
|
|
||||||
- [Evan Miller](http://www.evanmiller.org/ranking-items-with-star-ratings.html)
|
- [Evan Miller](http://www.evanmiller.org/ranking-items-with-star-ratings.html)
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'mysql2'
|
||||||
|
|
||||||
|
client = Mysql2::Client.new(host: '127.0.0.1', username: :root)
|
||||||
|
|
||||||
|
client.query('DROP DATABASE IF EXISTS rating_test;')
|
||||||
|
client.query('CREATE DATABASE IF NOT EXISTS rating_test;')
|
||||||
|
|
||||||
|
ActiveRecord::Base.establish_connection(adapter: :mysql2, database: :rating_test, username: :root, host: '127.0.0.1')
|
Loading…
Reference in New Issue