lib/find_mass_assignment.rb
# Return true if the model defines attr_accessible.
# Note that 'attr_accessible' must be preceded by nothing other than
# whitespace; this catches cases where attr_accessible is commented out.
Return true if the model defines attr_accessible.
Note that 'attr_accessible' must be preceded by nothing other than
whitespace; this catches cases where attr_accessible is commented out.
Return true if the model defines attr_accessible . Note that ' attr_accessible ' must be preceded by nothing other than whitespace ; this catches cases where attr_accessible is commented out .
def attr_accessible?
    model = "#{RAILS_ROOT}/app/models/#{self.underscore}.rb"
    if File.exist?(model)
      return @@cache[model] unless @@cache[model].nil?
      @@cache[model] = File.open(model).read =~ /^\s*attr_accessible/
    else
      true
    end
  end
def attr_accessible? model = "#{RAILS_ROOT}/app/models/#{self.underscore}.rb" if File . exist? ( model ) return @@cache [ model ] unless @@cache [ model ] . nil? @@cache [ model ] = File . open ( model ) . read =~ / ^ \s *attr_accessible / else true end end
Return true if the model defines attr_accessible.
Return true if the model defines attr_accessible .
# If the model file doesn't exist, ignore it by returning true. # This way, problem? is false and the item won't be flagged.