Guest User

Untitled

a guest
Apr 24th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. module ActiveRecord
  2.  
  3. class Base
  4. def self.translate_field data
  5. @data = data
  6. module_eval <<-"end;"
  7. def self.human_attribute_name(attr)
  8. "Pole <b>" + (@data[attr.to_sym] || 'Przetlumacz ' + attr) + "</b>"
  9. end
  10. end;
  11. end
  12. end
  13.  
  14. end
  15.  
  16. ### W modelu:
  17.  
  18. translate_field :cash_register_type_id => 'Typ kasy',
  19. :serial => 'Numer seryjny'
Add Comment
Please, Sign In to add comment