Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `attached' #1

Closed
picharras opened this issue Nov 30, 2011 · 3 comments
Closed

undefined method `attached' #1

picharras opened this issue Nov 30, 2011 · 3 comments

Comments

@picharras
Copy link

Hello, I have this error when migrating on rails 3.1.1

Run:

rake db:migrate
undefined method `attached' for #ActiveRecord::ConnectionAdapters::TableDefinition:0xb6c97cf8

My code is:

class CreateVideos < ActiveRecord::Migration
def self.up
create_table :videos do |t|
t.string :title
t.text :description
t.attached :video_hd

  t.timestamps
end

end

def self.down
drop_table :videos
end

end

@ksylvest
Copy link
Owner

ksylvest commented Dec 1, 2011

Sorry the read me had a bug in it. In your migration (note the change of t.attached to t.attachment) do:

class CreateVideos < ActiveRecord::Migration
  def self.up
    create_table :videos do |t|
      t.string :title
      t.text :description
      t.attachment :video_hd

      t.timestamps
    end
  end

  def self.down
    drop_table :videos
  end
end

Let me know if this fixes the problem.

@ksylvest
Copy link
Owner

ksylvest commented Dec 1, 2011

As an aside, you can see a full example application that uses the library and is specific for videos here:

https://github.com/ksylvest/zencodeit

@ksylvest
Copy link
Owner

ksylvest commented Dec 3, 2011

Closing after fixing documentation.

@ksylvest ksylvest closed this as completed Dec 3, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants