https://github.com/tomgi/acts_as_finder
https://github.com/tomgi/acts_as_finder
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/tomgi/acts_as_finder
- Owner: tomgi
- License: mit
- Created: 2012-07-02T20:43:52.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2012-07-03T18:43:26.000Z (almost 14 years ago)
- Last Synced: 2025-03-01T16:42:13.309Z (over 1 year ago)
- Language: Ruby
- Homepage: https://rubygems.org/gems/acts_as_finder
- Size: 153 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ActsAsFinder
This `acts_as` extension provides the capabilities for beautiful record finding by specified column(s).
## Installation
Add this line to your application's Gemfile:
gem 'acts_as_finder'
And then execute:
$ bundle
Or install it yourself as:
$ gem install acts_as_finder
## Example Usage
Assume you have following model:
class Language < ActiveRecord::Base
acts_as_finder :short_name, :name
end
And records in database:
+----+------------+---------+
| id | short_name | name |
+----+------------+---------+
| 1 | EN | English |
| 2 | PL | Polish |
+----+------------+---------+
Now you can use this extension like this:
>> Language.EN
=> #
>> Language.Polish
=> #
## Build Status
[](https://secure.travis-ci.org/tomgi/acts_as_finder)
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
5. Push to the branch (`git push origin my-new-feature`)
6. Create new Pull Request