Permalink
Browse files

apparently developer name can exceed 255, causing one dev to keyword …

…stuff in their name. Added hacky truncation on save.
  • Loading branch information...
1 parent 1742b8a commit 3d5ff2158ff905594e8258902370333a54bad628 @igmcdowell igmcdowell committed Dec 24, 2011
Showing with 6 additions and 0 deletions.
  1. +5 −0 app/models/app.rb
  2. +1 −0 lib/tasks/scheduler.rake
View
@@ -8,6 +8,11 @@ class App < ActiveRecord::Base
has_many :supported_devices, dependent: :destroy, foreign_key: "app_id"
after_create :add_price_history
after_save :check_price_change
+ before_save :truncate_values
+
+ def truncate_values
+ self.dev_name = self.dev_name[0,251]+'...'
+ end
def add_price_history
if prices.length > 0
@@ -5,6 +5,7 @@ desc "Update apps"
to_update.each do | app |
app.update_details
end
+ puts 'Updated Apps'
end
desc "Import apps."

0 comments on commit 3d5ff21

Please sign in to comment.