thetron / mongoid-enum

Sweet enum sugar for your Mongoid documents
MIT License
117 stars 167 forks source link

search translation in superclass if it's not in subclass. #34

Open jorgefernando1 opened 8 years ago

jorgefernando1 commented 8 years ago

When i have a inherited model and a enum in the superclass, I need to repeat the translation. E.g

class Employee
 enum :foo,  [:bar, :baz, :zaz]

class Manager < Employee

and in translation .yml file I need to have

enums:
  employee:
    foo:
      bar: BAR
      baz: BAZ
      zaz: ZAZ

  employees/manager:
    foo:
      bar: BAR
      baz: BAZ
      zaz: ZAZ

So if I don't have the employees/manager defined, its should search in the employee