Hi alll
Can any one volunteer why the class below fails? I can't seem to get
the set_schema operator to work.
- ... src/model/user.rb:18: undefined method `set_schema' for
User:Class (NoMethodError)
I fixed this by adding the Sequel::Model.plugin(:schema); and was
rewarded with minor progress of the following exception as my result:
- ... model/user.rb:39: undefined local variable or method
`create_table' for main:Object (NameError)
I've looked in the Sequel-3.0 lib/ folder and the set_schema method is
defined in a ClassMethods module.
I'm sure the solution is simple. I was thinking it should work "as
is". Or at least there'd be some nice get started paper to say you
need these plug-ins to achieve some basic operations.
Thanks in advance
/ will.
require 'sequel'
require 'logger'
LOGGER = Object.new()
def LOGGER.method_missing( name, args ) # cribbed form some place
else
puts "[#{name}] #{args}"
end
Sequel::Model.plugin(:schema) # I worked this
out, but I can't find it documented
DB = Sequel.sqlite('sql_test.db', :loggers => [LOGGER] )
class User < Sequel::Model(:user)
set_schema do
set_primary_key :id
String :name
end
end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---