class WPDB::Option

Public Class Methods

get_option(name) click to toggle source

Given the name of an option, will return the option value for that option - or nil of no option with that name exists.

@param [String] name The option_name to fetch @return String

# File lib/ruby-wpdb/option.rb, line 20
def self.get_option(name)
  Option.where(option_name: name).get(:option_value)
end

Public Instance Methods

before_validation() click to toggle source
Calls superclass method
# File lib/ruby-wpdb/option.rb, line 10
def before_validation
  self.autoload ||= "yes"
  super
end
validate() click to toggle source
Calls superclass method
# File lib/ruby-wpdb/option.rb, line 5
def validate
  super
  validates_presence [:option_name]
end