Method: Bookfile::BeerDef#prepare

Defined in:
lib/bookfile/database/database.rb

#prepareObject

change to require - why, why not??



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/bookfile/database/database.rb', line 61

def prepare   ## change to require - why, why not??

  puts "setup beer: #{@db_config.inspect}"

  res = require 'beerdb/models'

  ## also add to xxxx ???

  ## (possible to include as globals ???? how - Object.send :include ???) or

  ##   Module.send :include ??


  if res == false
    ## find a better check - check for constants defined??? if not define???

    ##  or use constant_missing handler???

    puts "  todo/fix: BeerDb::Models already included ??"
  end

  ## for now always include

  puts "  include BeerDb::Models"

  ### check/fix: include as globals/top-level!!! how? possible???

  Builder.send      :include, BeerDb::Models
  PageCtx.send      :include, BeerDb::Models
  HybookHelper.send :include, BeerDb::Models ## constants not accesible (include in module too)



end