Permalink
Browse files

human attribute

  • Loading branch information...
1 parent 5ebe204 commit 8b6a9a94bc6daed74faddb7ece4d7bf725cc0d11 @sled committed Oct 7, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/simple_enum.rb
View
@@ -193,6 +193,13 @@ def self.#{attr_name}_for_select(attr = :key, &block)
end
end
RUBY
+
+ instance_eval(<<-RUBY, __FILE__, __LINE__ + 1)
+ def human_#{attr_name}
+ self.human_enum_name(#{attr_name.inspect}, self.#{enum_cd})
+ end
+ end
+ RUBY
# only create if :slim is not defined
if options[:slim] != true

0 comments on commit 8b6a9a9

Please sign in to comment.