Sha256: bc1c6c494c34d69fa5767466194f43539049d72248c6df110536ad10acf25e73

Contents?: true

Size: 928 Bytes

Versions: 2

Compression:

Stored size: 928 Bytes

Contents

require 'rubygems'
require 'active_support'
require 'active_record'

ActiveRecord::Base.establish_connection(
  "adapter" => "sqlite3", "database" => ':memory:'
)

ActiveRecord::Base.logger = Logger.new(File.join(File.dirname(__FILE__), "debug.log"))

this_path = File.dirname(__FILE__)
load File.join(this_path, '/schema.rb')
require File.join(this_path, '..', 'lib', 'tunable.rb')

class TunableModel < ActiveRecord::Base
  include Tunable::Model
end

def load_main_settings!

  TunableModel.main_settings \
    :boolean_setting,
    :number_setting,
    :empty_setting,
    :on_off_setting,
    :y_n_setting,
    :other_setting

=begin
  TunableModel.main_settings ({
    :boolean_setting => { :default => true },
    :number_setting  => { :default => false },
    :empty_setting   => { },
    :on_off_setting  => { },
    :y_n_setting     => { :default => 'y', :strict => false },
    :other_setting   => { }
  })
=end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tunable-0.0.2 spec/spec_helper.rb
tunable-0.0.1 spec/spec_helper.rb