From b9ac5a495e2f780c52b659fd06a9968c83a7ef3b Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Mon, 13 Feb 2012 16:22:25 -0500 Subject: [PATCH] attr_accessible on Habit, & turn off whiny mass assignment for development --- app/models/habit.rb | 4 ++-- config/environments/development.rb | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/habit.rb b/app/models/habit.rb index 4a93065f5e..3b0998c983 100644 --- a/app/models/habit.rb +++ b/app/models/habit.rb @@ -6,8 +6,8 @@ class Habit < ActiveRecord::Base belongs_to :user default_scope :order => 'position ASC' - acts_as_list - + attr_accessible :name, :habit_type, :score, :notes, :up, :down, :done, :position + # TODO set cron for this def self.clear_done Habit.where(:habit_type => Habit::DAILY).collect do |h| diff --git a/config/environments/development.rb b/config/environments/development.rb index 5feb5543c4..b618c3b196 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -23,7 +23,8 @@ HabitTracker::Application.configure do config.action_dispatch.best_standards_support = :builtin # Raise exception on mass assignment protection for Active Record models - config.active_record.mass_assignment_sanitizer = :strict + # config.active_record.mass_assignment_sanitizer = :strict + config.active_record.mass_assignment_sanitizer = :logger # Log the query plan for queries taking more than this (works # with SQLite, MySQL, and PostgreSQL)