Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def lazy_load!(*names)
- # Expand names to a super set that included all properties in all contexts
- # that names is in. *names is a Symbol or and Array of Symbols
- ctx_names = self.class.lazy_load_properties.include_in_load(names)
- unless new_record? || @loaded_set.nil?
- @loaded_set.reload!(:fields => ctx_names )
- else
- ctx_names.each { |name| instance_variable_set(name.to_s.ensure_starts_with('@'), nil) }
- end
- end
Add Comment
Please, Sign In to add comment