Sha256: 4a29f6f1b325e7dc81ea02994f4fe6eff9dc7d9136e93338c79abec90412682b

Contents?: true

Size: 935 Bytes

Versions: 4

Compression:

Stored size: 935 Bytes

Contents

$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')

require 'bundler/setup'
require 'active_record'
require 'tunable'

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')

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

4 entries across 4 versions & 1 rubygems

Version Path
tunable-0.0.7 spec/spec_helper.rb
tunable-0.0.6 spec/spec_helper.rb
tunable-0.0.5 spec/spec_helper.rb
tunable-0.0.4 spec/spec_helper.rb