Module: ConfigureMe::Persistence

Included in:
Base
Defined in:
lib/configure_me/persistence.rb

Instance Method Summary collapse

Instance Method Details

#saveObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/configure_me/persistence.rb', line 8

def save(*)
  run_callbacks :save do
    persist_guard do
      temp_attributes.each_pair do |k,v|
        write_persist(k, v)
      end
    end
    temp_attributes.each_pair do |k,v|
      write_cache(k, v)
    end
    make_clean
  end
end

#update_attributes(new_attrs) ⇒ Object



22
23
24
25
26
27
# File 'lib/configure_me/persistence.rb', line 22

def update_attributes(new_attrs)
  new_attrs.each_pair do |k,v|
    write_attribute(k, v)
  end
  save
end