README.md in enum_ish-1.1.1 vs README.md in enum_ish-1.2.0
- old
+ new
@@ -3,10 +3,11 @@
A ruby and rails extension to generate enum-like methods.
## Dependencies
* ruby 2.3+
+* activerecord 5.0+
* activesupport 5.0+
## Installation
Add this line to your application's Gemfile:
@@ -135,12 +136,27 @@
user.status = :_enable
user.status #=> :_enable
user.status_raw #=> "enable"
```
-### Scope (for ActiveRecord)
+### ActiveRecord features
+#### Accessor
+
+Generate accessor:
+
+```ruby
+class User < ActiveRecord::Base
+ extend EnumIsh
+ enum_ish :status, { _enable: 'enable', _disable: 'disable' }, accessor: true
+end
+
+User.where(status: :_enable) #=> SELECT "users".* FROM "users" WHERE "users"."status" = "enable"
+```
+
+#### Scope
+
Generate scope:
```ruby
class User < ActiveRecord::Base
extend EnumIsh
@@ -148,10 +164,10 @@
end
User.with_status(:enable) #=> SELECT "users".* FROM "users" WHERE "users"."status" = "enable"
```
-### Validation (for ActiveRecord)
+#### Validation
Generate validation:
```ruby
class User < ActiveRecord::Base