adds Settings

This commit is contained in:
Juanjo Bazán
2015-08-17 18:13:30 +02:00
parent fabcb42328
commit a13f4920a1
3 changed files with 21 additions and 1 deletions

7
app/models/setting.rb Normal file
View File

@@ -0,0 +1,7 @@
class Setting < ActiveRecord::Base
default_scope { order(key: :desc) }
def self.value_for(key)
where(key: key).pluck(:value).first
end
end