... | ... | @@ -15,7 +15,8 @@ Just as a reference, we will be using this table for the examples: |
|
|
```ruby
|
|
|
create_table :posts do |t|
|
|
|
t.string :title
|
|
|
t.permissions :creator_permissions, array: true
|
|
|
t.permissions :creator_permissions, array: true # ONLY RAILS < 7.0
|
|
|
t.enum :creator_permissions, enum_type: :creator_permissions, array: true # ONLY RAILS >= 7.0
|
|
|
end
|
|
|
```
|
|
|
|
... | ... | @@ -59,7 +60,7 @@ You have to go to each of your models and enable the functionality for each enum |
|
|
```ruby
|
|
|
# models/user.rb
|
|
|
class Post < ActiveRecord::Base
|
|
|
enum_set :creator_permissions
|
|
|
torque_enum_set :creator_permissions
|
|
|
end
|
|
|
```
|
|
|
|
... | ... | |