create model/migration based on an fog object

22 views
Skip to first unread message

Henderson Alexandre

unread,
May 30, 2012, 10:21:15 AM5/30/12
to ruby-fog
Hello,

I would like to mention the obvious that you will notice, I am still
learning the ropes of ruby on rails, so I hope that I do not cause
offence by posting my rails question here as it related to the
Fog::Compute::AWS::Server object.

I would like to store the Fog::Compute::AWS::Server in my own database/
model/migration.

I have added the fog gem to my Gemfile

I tried to create the model like so, as I would usually create a
model, but using the Fog data type:


[heptagone@DevServer desktop]$ rails generate model fogaws
fogobject:Fog
invoke active_record
create db/migrate/20120530114756_create_fogaws.rb
create app/models/fogaws.rb
invoke test_unit
create test/unit/fogaws_test.rb
create test/fixtures/fogaws.yml

However when I try the rake db:migrate I get this show stopper:


== CreateFogaws: migrating
===================================================
-- create_table(:fogaws)
rake aborted!
An error has occurred, this and all later migrations canceled:

undefined method `Fog' for
#<ActiveRecord::ConnectionAdapters::TableDefinition:0x7fb3bc773798>


Help will be appreciated...Thanks

geemus (Wesley Beary)

unread,
Jun 4, 2012, 8:52:22 AM6/4/12
to ruby...@googlegroups.com
Sorry, but I don't really have much experience with this sort of thing
(I haven't really worked on a rails app in a few years). I'm not sure
that there is a direct way to do what you want to do, I think you may
have to make separate models and manually integrate with fog but due
to my lack of experience with Rails I'm not sure. I had hoped
somebody with a bit more knowledge might be able to help (hence why I
waited a few days to reply).
wes
Reply all
Reply to author
Forward
0 new messages