diff --git a/app/controllers/data_controller.rb b/app/controllers/data_controller.rb index 1dcf4a58..587d9ad3 100644 --- a/app/controllers/data_controller.rb +++ b/app/controllers/data_controller.rb @@ -33,7 +33,7 @@ class DataController < ApplicationController when 'todos' @labels = [:description, :context, :project, :notes, :created_at, :due, :completed_at] else - flash[:error] = "Ivalid import desitination" + flash[:error] = "Invalid import destination" redirect_to :back end respond_to do |format| diff --git a/app/models/project.rb b/app/models/project.rb index 014ad70a..46d369ff 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -137,7 +137,7 @@ class Project < ActiveRecord::Base @age_in_days ||= (Date.today - created_at.to_date + 1).to_i end - def self.import params, user + def self.import(params, user) count = 0 CSV.foreach(params[:file], headers: true) do |row| unless find_by_name_and_user_id row[params[:name].to_i], user.id @@ -151,7 +151,7 @@ class Project < ActiveRecord::Base end end count - end + end end diff --git a/app/models/todo.rb b/app/models/todo.rb index 99f538bb..72ee25d9 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -1,6 +1,6 @@ class Todo < ActiveRecord::Base - MAX_DESC_LENGTH = 300 + MAX_DESCRIPTION_LENGTH = 300 MAX_NOTES_LENGTH = 60000 before_save :render_note @@ -393,7 +393,7 @@ class Todo < ActiveRecord::Base end end - def self.import params, user + def self.import(params, user) default_context = Context.where(:user_id=>user.id).order('id').first count = 0 @@ -414,6 +414,6 @@ class Todo < ActiveRecord::Base end end count - end + end end