Class: Lokka::Database
- Inherits:
-
Object
- Object
- Lokka::Database
- Defined in:
- lib/lokka.rb
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize ⇒ Database
constructor
A new instance of Database.
- #setup ⇒ Object
Constructor Details
Instance Method Details
#create ⇒ Object
46 47 48 49 50 |
# File 'lib/lokka.rb', line 46 def create puts 'Creating Database...' @@models.each {|m| m.auto_migrate! } self end |
#setup ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/lokka.rb', line 52 def setup puts 'Initializing Database...' User.create( :name => 'test', :password => 'test', :password_confirmation => 'test') Site.create( :title => 'Test Site', :description => 'description...', :theme => 'jarvi') Post.create( :user_id => 1, :title => "Test Post", :body => "<p>Wellcome to Lokka!</p>\n<p><a href=\"/admin/\">Admin login</a> (user / password : test / test)</p>") self end |