| 120 | | def clear_persistant_model_associations #:doc: |
|---|
| 121 | | if session = @session.instance_variable_get("@data") |
|---|
| 122 | | session.each { |key, obj| obj.clear_association_cache if obj.respond_to?(:clear_association_cache) } |
|---|
| | 120 | # Clear cached associations in session data so they don't overflow |
|---|
| | 121 | # the database field. Only applies to ActiveRecordStore since there |
|---|
| | 122 | # is not a standard way to iterate over session data. |
|---|
| | 123 | def clear_persistent_model_associations #:doc: |
|---|
| | 124 | if defined?(@session) and @session.instance_variables.include?('@data') |
|---|
| | 125 | session_data = @session.instance_variable_get('@data') |
|---|
| | 126 | if session_data and session_data.respond_to?(:each_value) |
|---|
| | 127 | session_data.each_value do |obj| |
|---|
| | 128 | if obj.respond_to?(:clear_association_cache) |
|---|
| | 129 | obj.clear_association_cache |
|---|
| | 130 | end |
|---|
| | 131 | end |
|---|
| | 132 | end |
|---|