lib/app/models/magic_locales/language.rb in magic_locales-0.0.2 vs lib/app/models/magic_locales/language.rb in magic_locales-0.0.3
- old
+ new
@@ -6,10 +6,10 @@
# =====> C O N S T A N T S <=============================================================== #
LEVELS = %w(basic medium advanced excelent) # => and 'native'
# =====> A S S O Z I A T I O N S <========================================================= #
- belongs_to :user, class_name: "User", foreign_key: :user_id
+ belongs_to :owner, polymorphic: true
belongs_to :locale, class_name: "Wizard::Locale", foreign_key: :locale_id
# =====> A T T R I B U T E S <============================================================= #
delegate :name, :iso_code, to: :locale, allow_nil: true