A lot :)
This commit is contained in:
parent
aad67af0d1
commit
63fc206c27
153 changed files with 2043 additions and 646 deletions
|
|
@ -2,4 +2,17 @@
|
|||
|
||||
class ApplicationRecord < ActiveRecord::Base
|
||||
primary_abstract_class
|
||||
|
||||
class << self
|
||||
def translates_attributes(*attributes)
|
||||
attributes.each do |attribute|
|
||||
define_method("t_#{attribute}") do
|
||||
lang = I18n.locale.to_s.split("-").first
|
||||
send("#{attribute}_#{lang}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
alias_method :translates_attribute, :translates_attributes
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue