require 'og'
psql_config = {
:destroy => true,
:name => 'test',
:store => 'psql',
:user => 'postgres',
:password => 'gmrulez'
}
mysql_config = {
:destroy => true,
:name => 'test',
:store => 'mysql',
:user => 'root',
:password => 'gmrulez'
}
psql = Og.connect(psql_config)
mysql = Og.connect(mysql_config)
class Article
attr_accessor :name, :body, String
def initialize(name = nil, body = nil)
@name, @body = name, body
end
end
mysql.manage(Article)
a1 = Article.create('name1', 'body1')
a1 = Article.create('name1', 'body1')
a1 = Article.create('name1', 'body1')
articles = Article.all
psql.manage(Article)
for article in articles
article.insert
end
article = Article.find_by_name('name1')
Latest changes
All changes