User.migrate!
Parameters:
See Also:
24 25 26
# File 'lib/swift/migrations.rb', line 24 def migrate! db = Swift.db db.migrate! self end
class User < Swift::Record migrations do |db| db.execute %q{create table users(id serial, name text, age int)} end end
14 15 16
# File 'lib/swift/migrations.rb', line 14 def migrations &migrations define_singleton_method(:migrate!, lambda{|db = Swift.db| migrations.call(db)}) end