move to strong_parameters of rails4.

This commit is contained in:
Reinier Balt 2013-05-27 12:44:31 +02:00
parent 049296fd33
commit 671f64b419
24 changed files with 153 additions and 61 deletions

View file

@ -1,7 +1,6 @@
class Context < ActiveRecord::Base
has_many :todos, -> { order("todos.due IS NULL, todos.due ASC, todos.created_at ASC").includes(:project) }, :dependent => :delete_all
has_many :todos, -> { order("todos.due IS NULL, todos.due ASC, todos.created_at ASC").includes(:project) }, :dependent => :delete_all
has_many :recurring_todos, :dependent => :delete_all
belongs_to :user
@ -34,8 +33,6 @@ class Context < ActiveRecord::Base
end
end
attr_protected :user
validates_presence_of :name, :message => "context must have a name"
validates_length_of :name, :maximum => 255, :message => "context name must be less than 256 characters"
validates_uniqueness_of :name, :message => "already exists", :scope => "user_id"