Created
June 19, 2011 18:35
-
-
Save morganp/1034572 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pp' | |
require 'yaml' | |
require 'active_record' | |
@environment = ENV['RACK_ENV'] || 'development' | |
@dbconfig = YAML.load(File.read('config/database.yml')) | |
ActiveRecord::Base.establish_connection @dbconfig[@environment] | |
require './app/models/user' | |
require './app/models/authorization' | |
require './app/models/article' | |
require './app/models/tagging' | |
require './app/models/tag' | |
puts "HelloWorld" | |
@user = User.create( | |
:name => 'Morgan', | |
:github => 'example_github', | |
:email => '[email protected]', | |
:twitter => 'tweeter', | |
:location => 'Edinburgh', | |
:about => 'Helloworld', | |
) | |
@user.save | |
@user = User.first | |
pp @user | |
@article = @user.articles.create( | |
:official => false, | |
:url => 'http://amaras-tech.co.uk/', | |
:title => 'Example Title', | |
:body => 'Helllo fols brief update here please check it out', | |
) | |
@article.save | |
@article = Article.first | |
puts | |
pp @article | |
puts | |
@user_articles = @user.articles.all | |
pp @user_articles | |
@article.delete | |
@user.delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment