Sha256: 7d97c2509c08c964e4a03606705e2dc5bdedc653b0d62bac754b5b0fd4d17440

Contents?: true

Size: 1.27 KB

Versions: 16

Compression:

Stored size: 1.27 KB

Contents

class Setting < ActiveRecord::Base
  attr_accessible :activated, :key, :name, :system, :value, :image, :image_cache

  mount_uploader :image, Settings::ImageUploader
  
  def self.app_title
    begin
      Setting.where(key: 'app_title', activated: true).first.value
    rescue
      false
    end
  end

  def self.app_email
    begin
      Setting.where(key: 'app_email', activated: true).first.value
    rescue
      false
    end
  end
  
  def self.admix_logo
    begin
      Setting.where(key: 'admix_logo', activated: true).first
    rescue
      false
    end
  end

  def self.link_twitter
    begin
      Setting.where(key: 'link_twitter', activated: true).first.value
    rescue
      false
    end
  end

  def self.link_facebook
    begin
      Setting.where(key: 'link_facebook', activated: true).first.value
    rescue
      false
    end
  end

  def self.link_instagram
    begin
      Setting.where(key: 'link_instagram', activated: true).first.value
    rescue
      false
    end
  end

  def self.albums_watermark
    begin
      Setting.where(key: 'albums_watermark', activated: true).first
    rescue
      false
    end
  end

  def self.albums_title
    begin
      Setting.where(key: 'albums_title', activated: true).first.value
    rescue
      false
    end
  end


end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
mix-rails-0.26.3 mix-rails-settings/app/models/setting.rb
mix-rails-settings-0.26.3 app/models/setting.rb
mix-rails-0.26.2 mix-rails-settings/app/models/setting.rb
mix-rails-settings-0.26.2 app/models/setting.rb
mix-rails-0.26.1 mix-rails-settings/app/models/setting.rb
mix-rails-settings-0.26.1 app/models/setting.rb
mix-rails-0.26.0 mix-rails-settings/app/models/setting.rb
mix-rails-settings-0.26.0 app/models/setting.rb
mix-rails-0.25.1 mix-rails-settings/app/models/setting.rb
mix-rails-settings-0.25.1 app/models/setting.rb
mix-rails-0.25.0 mix-rails-settings/app/models/setting.rb
mix-rails-settings-0.25.0 app/models/setting.rb
mix-rails-0.24.1 mix-rails-settings/app/models/setting.rb
mix-rails-settings-0.24.1 app/models/setting.rb
mix-rails-0.24.0 mix-rails-settings/app/models/setting.rb
mix-rails-settings-0.24.0 app/models/setting.rb