I am using the fog gem.

The fog gem has been added to my Gemfile

I would like to store the Fog object in my own database/model/
migration.

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




[tago@DevServer my]$ 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>






Here is what a Fog object can look like:
server = connection.servers.create
<Fog::Compute::AWS::Server
id="i-0984916f",
ami_launch_index=0,
availability_zone="us-east-1c",
block_device_mapping=[],
client_token=nil,
dns_name=nil,
groups=["default"],
flavor_id="t1.micro",
image_id="ami-3202f25b",
kernel_id="aki-427d952b",
key_name=nil,
created_at=Wed May 30 00:50:41 UTC 2012,
monitoring=false,
placement_group=nil,
platform=nil,
product_codes=[],
private_dns_name=nil,
private_ip_address=nil,
public_ip_address=nil,
ramdisk_id=nil,
reason=nil,
root_device_name=nil,
root_device_type="ebs",
security_group_ids=nil,
state="pending",
state_reason=nil,
subnet_id=nil,
tenancy="default",
tags=nil,
user_data=nil,
vpc_id=nil
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMay 30, '12 at 9:44p
activeMay 31, '12 at 7:47a
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Colin Law: 1 post Eldorado554: 1 post

People

Translate

site design / logo © 2021 Grokbase