Module: Katello::LazyAccessor::InstanceMethods
- Defined in:
- app/lib/katello/lazy_accessor.rb
Instance Method Summary collapse
- #changed_remote_attributes ⇒ Object
- #changed_remote_attributes=(val) ⇒ Object
- #lazy_attributes ⇒ Object
- #reload ⇒ Object
- #save ⇒ Object
- #save! ⇒ Object
Instance Method Details
#changed_remote_attributes ⇒ Object
51 52 53 |
# File 'app/lib/katello/lazy_accessor.rb', line 51 def changed_remote_attributes @changed_remote_attributes ||= {} end |
#changed_remote_attributes=(val) ⇒ Object
55 56 57 |
# File 'app/lib/katello/lazy_accessor.rb', line 55 def changed_remote_attributes=(val) @changed_remote_attributes = val end |
#lazy_attributes ⇒ Object
78 79 80 81 82 |
# File 'app/lib/katello/lazy_accessor.rb', line 78 def lazy_attributes attrs = (self.class.superclass.respond_to? :lazy_attributes) ? self.class.superclass.lazy_attributes : [] attrs += (self.class.lazy_attributes || []) attrs.uniq end |
#reload ⇒ Object
72 73 74 75 76 |
# File 'app/lib/katello/lazy_accessor.rb', line 72 def reload(*) super.tap do changed_remote_attributes.clear end end |
#save ⇒ Object
59 60 61 62 63 64 |
# File 'app/lib/katello/lazy_accessor.rb', line 59 def save(*) if (status = super) changed_remote_attributes.clear end status end |
#save! ⇒ Object
66 67 68 69 70 |
# File 'app/lib/katello/lazy_accessor.rb', line 66 def save!(*) super.tap do changed_remote_attributes.clear end end |