README.md in uniqable-0.3.1 vs README.md in uniqable-0.3.2
- old
+ new
@@ -41,24 +41,20 @@
anyway you have one more method `.find_uniqable` which one you can use to find your model record
```ruby
MyModel.find_uniqable params[:uid]
# or
MyModel.find_uniqable! params[:uid] # this will raise exception ActiveRecord::RecordNotFound if record is absent
- # or you can use numerical ID same time and Uniqable will detect it and tries to find by primary key (as regular id)
- MyModel.find_uniqable params[:id]
- # or
- MyModel.find_uniqable! params[:id]
```
and another one is `.uniqable_fields`
```ruby
MyModel.uniqable_fields
```
You can also create your own token callback method and set the field:
```ruby
class MyModel
- ...
+ #...
def uniqable_uid(field)
self[field] = 100_000 + rand(999_999)
end
end
```