attr_accessible on Habit, & turn off whiny mass assignment for development

This commit is contained in:
Tyler Renelle
2012-02-13 16:22:25 -05:00
parent c29140e74e
commit b9ac5a495e
2 changed files with 4 additions and 3 deletions

View File

@@ -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|

View File

@@ -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)