Question: I'm applying [enum](http://api.rubyonrails.org/v4.1.0/classes/ActiveRecord/Enum.html) on the following attribute: `transparency`

The same attribute (with enum) is used in two different models: `Category` and `Post`

Is it possible to share the enum values between models, to avoid code duplication:

```
enum transparency: %w(anonymous private public)

```

Answer: 
You can use a [concern](https://signalvnoise.com/posts/3372-put-chubby-models-on-a-diet-with-concerns).

```
module HasTransparency
  extend ActiveSupport::Concern
  included do
    enum transparency: %w(anonymous private public)
  end
end

```

Then include it in your models:

```
class Category < ActiveRecord::Base
  include HasTransparency

  ....
end

```
An alternative to "the right way" of using a concern or module, you can just make reference to another class enum. It worked perfectly for me:

```
enum same_values_than_other: SomeOtherClass.my_awesome_enum

```