Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Needs more rain

  • Loading branch information...
commit b3af5a830bf68df07a7e6f2546081efeb136f2af 1 parent 65e561f
@amiel authored
View
5 app/models/observation.rb
@@ -16,4 +16,9 @@ def self.need_fetch?
return true unless Observation.first :select => 'id'
Observation.last(:select => 'id, observed_at').observed_at < 35.minutes.ago
end
+
+ def rain
+ r = read_attribute(:rain)
+ r * 25.4 if r # To MM
+ end
end
View
18 config/environment.rb
@@ -1,8 +1,22 @@
# Be sure to restart your server when you modify this file
# Specifies gem version of Rails to use when vendor/rails is not present
-# RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION
-RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION
+# RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
+
+# https://makandracards.com/makandra/1109-fixing-undefined-local-variable-or-method-version_requirements-for-rails-gemdependency-0x-nameerror
+# or http://excid3.com/blog/undefined-local-variable-or-method-version_requirements-for-nameerror/
+# or https://gist.github.com/807008#gistcomment-20117
+if defined?(Gem) && Gem::VERSION >= "1.3.6"
+ module Rails
+ class GemDependency
+ def requirement
+ r = super
+ (r == Gem::Requirement.default) ? nil : r
+ end
+ end
+ end
+end
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
View
2  config/locales/en.yml
@@ -40,7 +40,7 @@ en:
unit: "&deg;F"
rain:
title: Rain Rate
- unit: in # " in &times; 10"
+ unit: mm # " in &times; 10"
time:
formats:
long: '%a, %b %d, %Y %H:%M %Z'
View
2  lib/observation_mixin.rb
@@ -38,6 +38,6 @@ def observed_at_for_flot
end
def attribute_pair_for_plot(attribute)
- [ self.observed_at_for_flot, self[attribute] ]
+ [ self.observed_at_for_flot, self.send(attribute) ]
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.