| Fixup for rails4, detect non-integer project ids - warvox - VoIP based wardiali… | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit e82fea798bf6469bced559a5ea661e2f49c6bfb0 | |
| parent a86e1bf9542e976afd0d2162ab4d39413826d214 | |
| Author: HD Moore <[email protected]> | |
| Date: Tue, 10 Feb 2015 16:18:50 -0600 | |
| Fixup for rails4, detect non-integer project ids | |
| Diffstat: | |
| M bin/export_list.rb | 7 +++++-- | |
| 1 file changed, 5 insertions(+), 2 deletions(-) | |
| --- | |
| diff --git a/bin/export_list.rb b/bin/export_list.rb | |
| @@ -32,6 +32,10 @@ if(project_id and project_id == "-h") | |
| usage() | |
| end | |
| +if project_id.to_i == 0 | |
| + usage() | |
| +end | |
| + | |
| require 'config/boot' | |
| require 'config/environment' | |
| @@ -51,8 +55,7 @@ begin | |
| if line_type | |
| cond[:line_type] = line_type.downcase | |
| end | |
| - | |
| - Call.where(cond).find(:order => :number) do |r| | |
| + Call.where(cond).order(number: :asc).each do |r| | |
| out = [] | |
| fields.each do |f| | |
| out << r[f].to_s |