README.md in arqo-0.1.0 vs README.md in arqo-0.2.0
- old
+ new
@@ -94,10 +94,26 @@
you can use it like this:
```ruby
CustomNamedQuery.new(User.all).active_last_week
```
+you can also set the model class or relation to query from by overriding a simple method, like:
+
+```ruby
+class CustomNamedQuery < ARQO::Query
+ module Scope
+ # ...
+ end
+
+ private
+
+ def associated_relation
+ User # you can also do something like User.some_scope
+ end
+end
+```
+
## Chaining scopes
Of course you can chain everything together, methods defined in the query object and scopes defined in the model or by Rails.
```ruby
# app/queries/user_query.rb
@@ -125,19 +141,19 @@
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
-Bug reports and pull requests are welcome on GitHub at https://github.com/santib/arqo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/santib/arqo/blob/master/CODE_OF_CONDUCT.md).
+Bug reports and pull requests are welcome on GitHub at https://github.com/rootstrap/arqo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/rootstrap/arqo/blob/master/CODE_OF_CONDUCT.md).
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
## Code of Conduct
-Everyone interacting in the ARQO project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/santib/arqo/blob/master/CODE_OF_CONDUCT.md).
+Everyone interacting in the ARQO project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rootstrap/arqo/blob/master/CODE_OF_CONDUCT.md).
## Logo attribution
Logo made by [iconixar](https://www.flaticon.com/free-icon/archery_3080892) from [www.flaticon.com](https://www.flaticon.com/)
## Credits