diff options
Diffstat (limited to 'railties/builtin')
-rw-r--r-- | railties/builtin/rails_info/rails/info.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/railties/builtin/rails_info/rails/info.rb b/railties/builtin/rails_info/rails/info.rb index b73cc13409..c8bc9cb4f1 100644 --- a/railties/builtin/rails_info/rails/info.rb +++ b/railties/builtin/rails_info/rails/info.rb @@ -3,14 +3,16 @@ module Rails mattr_accessor :properties class << (@@properties = []) def names - map {|(name, )| name} + map { |name, value| name } end - + def value_for(property_name) - find {|(name, )| name == property_name}.last rescue nil + if property = find { |name, value| name == property_name } + property.last + end end end - + class << self #:nodoc: def property(name, value = nil) value ||= yield |