4

I'm new to ruby, sinatra and padrino, so it might be a silly question, but:
Is there a way to add an orm to an existing application ?

My problem is that I have created an application with the following command line:

$ padrino-gen project sample_blog -a mysql -b

(I thought that a default ORM was selected.)
Then tried to add a model:

$ padrino-gen model post title:string body:text
<= You need an ORM adapter for run this generator. Sorry!

How can I add the orm without recreatting the whole application?
It's not very important now, since the application do not contains anything, but I plan latter to add tests, and I would like to know if it's easy.

Thanks for your tips for a beginner.

cyrilchampier
  • 2,207
  • 1
  • 25
  • 39

1 Answers1

5

Open /project-name/.components with your editor and add

:orm: activerecord
bluish
  • 26,356
  • 27
  • 122
  • 180
DAddYE
  • 1,719
  • 11
  • 16
  • 4
    You will also need to add this to your Gemfile. `gem 'activerecord', :require => "active_record"`. Finally you will need to manually create a `config/database.rb` file to define the database connection. – Scott Harvey Mar 10 '13 at 12:59