Module: AttrRemote::InstanceMethods

Defined in:
lib/attr_remote.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



155
156
157
158
# File 'lib/attr_remote.rb', line 155

def self.included(base)
  base.alias_method_chain :save, :dirty_remote
  base.alias_method_chain :save!, :dirty_remote
end

Instance Method Details

#remote_attributes_changed?Boolean

Returns:

  • (Boolean)


160
161
162
# File 'lib/attr_remote.rb', line 160

def remote_attributes_changed?
  @remote_attributes_changed == true
end

#save_with_dirty_remote(*args) ⇒ Object

:nodoc:



164
165
166
167
168
169
# File 'lib/attr_remote.rb', line 164

def save_with_dirty_remote(*args) #:nodoc:
  if status = save_without_dirty_remote(*args)
    @remote_attributes_changed = false
  end
  status
end

#save_with_dirty_remote!(*args) ⇒ Object

:nodoc:



170
171
172
173
174
# File 'lib/attr_remote.rb', line 170

def save_with_dirty_remote!(*args) #:nodoc:
  status = save_without_dirty_remote!(*args)
  @remote_attributes_changed = false
  status
end