Sha256: 111ce8e7f4daf0a42dc14879f5e62a9198e781a84b897ac4aecafbe7e1aa69f8

Contents?: true

Size: 405 Bytes

Versions: 27

Compression:

Stored size: 405 Bytes

Contents

class Setting < ActiveRecord::Base
  has_paper_trail  
  acts_as_indexed :fields => [:name, :value, :note]  
  include Soapbox::Setting if File.exists? "app/models/soapbox/setting.rb"
  
  def self.[](name)
    find_or_create_by_name(name).try(:value)
  end
  
  def self.[]=(name, v)
    setting = find_or_create_by_name(name)
    setting.value = (v ? v : "")
    setting.save
    setting.value
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
soapbox-0.3.1 app/models/setting.rb
soapbox-0.3.0 app/models/setting.rb
soapbox-0.2.24 app/models/setting.rb
soapbox-0.2.23 app/models/setting.rb
soapbox-0.2.21 app/models/setting.rb
soapbox-0.2.20 app/models/setting.rb
soapbox-0.2.18 app/models/setting.rb
soapbox-0.2.16 app/models/setting.rb
soapbox-0.2.15 app/models/setting.rb
soapbox-0.2.14 app/models/setting.rb
soapbox-0.2.12 app/models/setting.rb
soapbox-0.2.11 app/models/setting.rb
soapbox-0.2.10 app/models/setting.rb
soapbox-0.2.9 app/models/setting.rb
soapbox-0.2.8 app/models/setting.rb
soapbox-0.2.7 app/models/setting.rb
soapbox-0.2.6 app/models/setting.rb
soapbox-0.2.5 app/models/setting.rb
soapbox-0.2.4 app/models/setting.rb
soapbox-0.2.3 app/models/setting.rb