Class: Brakeman::Model

Inherits:
Collection
  • Object
show all
Includes:
ModelMethods
Defined in:
lib/brakeman/tracker/model.rb

Constant Summary collapse

ASSOCIATIONS =

Instance Attribute Summary

Attributes included from ModelMethods

#associations, #attr_accessible, #role_accessible

Instance Method Summary collapse

Methods included from ModelMethods

#association?, #attr_protected, #initialize_model, #parent_classes_protected?, #set_attr_accessible, #set_attr_protected, #unprotected_model?

Constructor Details

#initialize(name, parent, file_name, src, tracker) ⇒ Model

Returns a new instance of Model.



75
76
77
78
79
# File 'lib/brakeman/tracker/model.rb', line 75

def initialize name, parent, file_name, src, tracker
  super
  initialize_model
  @collection = tracker.models
end

Instance Method Details

#add_option(name, exp) ⇒ Object



81
82
83
84
85
86
87
88
# File 'lib/brakeman/tracker/model.rb', line 81

def add_option name, exp
  if ASSOCIATIONS.include? name
    @associations[name] ||= []
    @associations[name].concat exp.args
  else
    super name, exp.arglist.line(exp.line)
  end
end