lib/audited/auditor.rb in audited-3.0.0 vs lib/audited/auditor.rb in audited-4.0.0.rc1

- old
+ new

@@ -28,23 +28,14 @@ # You can add to those by passing one or an array of fields to skip. # # class User < ActiveRecord::Base # audited :except => :password # end - # * +protect+ - If your model uses +attr_protected+, set this to false to prevent Rails from - # raising an error. If you declare +attr_accessible+ before calling +audited+, it - # will automatically default to false. You only need to explicitly set this if you are - # calling +attr_accessible+ after. # # * +require_comment+ - Ensures that audit_comment is supplied before # any create, update or destroy operation. # - # class User < ActiveRecord::Base - # audited :protect => false - # attr_accessible :name - # end - # def audited(options = {}) # don't allow multiple calls return if self.included_modules.include?(Audited::Auditor::AuditedInstanceMethods) class_attribute :non_audited_columns, :instance_writer => false @@ -64,12 +55,9 @@ validates_presence_of :audit_comment, :if => :auditing_enabled before_destroy :require_comment end attr_accessor :audit_comment - unless options[:allow_mass_assignment] - attr_accessible :audit_comment - end has_many :audits, :as => :auditable, :class_name => Audited.audit_class.name Audited.audit_class.audited_class_names << self.to_s after_create :audit_create if !options[:on] || (options[:on] && options[:on].include?(:create))