Guest User

Untitled

a guest
Apr 19th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. def lazy_load!(*names)
  2. # Expand names to a super set that included all properties in all contexts
  3. # that names is in. *names is a Symbol or and Array of Symbols
  4. ctx_names = self.class.lazy_load_properties.include_in_load(names)
  5. unless new_record? || @loaded_set.nil?
  6. @loaded_set.reload!(:fields => ctx_names )
  7. else
  8. ctx_names.each { |name| instance_variable_set(name.to_s.ensure_starts_with('@'), nil) }
  9. end
  10. end
Add Comment
Please, Sign In to add comment