project.rb 529 B

123456789101112131415
  1. class Project < ApplicationRecord
  2. has_one_attached :logo
  3. has_and_belongs_to_many :technologies
  4. has_many :projectUrls
  5. belongs_to :license
  6. def i18n_title
  7. return Text.where(user_id: self.user_id, language: I18n.locale, key: self.title)[0].text
  8. end
  9. def i18n_header
  10. return Text.where(user_id: self.user_id, language: I18n.locale, key: self.header)[0].text
  11. end
  12. def i18n_text
  13. return Text.where(user_id: self.user_id, language: I18n.locale, key: self.text)[0].text
  14. end
  15. end