Sha256: 7ff7703efb4ef48c44136f885fc7c556fe631b5612f6ead48230d45ae9ae8555

Contents?: true

Size: 661 Bytes

Versions: 17

Compression:

Stored size: 661 Bytes

Contents

require 'pathname'
require 'logger'

root_path = Pathname(__FILE__).dirname.join('..').expand_path
lib_path  = root_path.join('lib')
$:.unshift(lib_path)

require 'active_record'
ActiveRecord::Base.establish_connection({
  adapter: 'sqlite3',
  database: ':memory:',
})

require 'generators/flipper/templates/migration'
CreateFlipperTables.up

require 'flipper/adapters/active_record'
adapter = Flipper::Adapters::ActiveRecord.new
flipper = Flipper.new(adapter)

flipper[:stats].enable

if flipper[:stats].enabled?
  puts "Enabled!"
else
  puts "Disabled!"
end

flipper[:stats].disable

if flipper[:stats].enabled?
  puts "Enabled!"
else
  puts "Disabled!"
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
flipper-active_record-0.11.0.beta7 examples/active_record/basic.rb
flipper-active_record-0.11.0.beta6 examples/active_record/basic.rb
flipper-active_record-0.11.0.beta5 examples/active_record/basic.rb
flipper-active_record-0.11.0.beta4 examples/active_record/basic.rb
flipper-active_record-0.11.0.beta3 examples/active_record/basic.rb
flipper-active_record-0.11.0.beta1 examples/active_record/basic.rb
flipper-active_record-0.10.2 examples/active_record/basic.rb
flipper-active_record-0.10.1 examples/active_record/basic.rb
flipper-active_record-0.10.0 examples/active_record/basic.rb
flipper-active_record-0.9.2 examples/active_record/basic.rb
flipper-active_record-0.9.1 examples/active_record/basic.rb
flipper-active_record-0.9.0 examples/active_record/basic.rb
flipper-active_record-0.9.0.beta1 examples/active_record/basic.rb
flipper-active_record-0.8.0 examples/active_record/basic.rb
flipper-active_record-0.7.5 examples/active_record/basic.rb
flipper-active_record-0.7.4 examples/active_record/basic.rb
flipper-active_record-0.7.3 examples/active_record/basic.rb