Class: WPDB::Option
- Inherits:
-
Object
- Object
- WPDB::Option
- Defined in:
- lib/ruby-wpdb/options.rb
Class Method Summary collapse
-
.get_option(name) ⇒ Object
Given the name of an option, will return the option value for that option - or nil of no option with that name exists.
Instance Method Summary collapse
Class Method Details
.get_option(name) ⇒ Object
Given the name of an option, will return the option value for that option - or nil of no option with that name exists.
20 21 22 |
# File 'lib/ruby-wpdb/options.rb', line 20 def self.get_option(name) Option.where(:option_name => name).get(:option_value) end |
Instance Method Details
#before_validation ⇒ Object
10 11 12 13 |
# File 'lib/ruby-wpdb/options.rb', line 10 def before_validation self.autoload ||= "yes" super end |
#validate ⇒ Object
5 6 7 8 |
# File 'lib/ruby-wpdb/options.rb', line 5 def validate super validates_presence [:option_name] end |