Displaying 7 results from an estimated 7 matches for "create_versioned_table".
2007 Mar 25
1
Can't use models in migrations
...s
1.2 but I''m sure its not.
I can''t use AR models in my migrations. To make sure its not just my
dodgy code I tried to do the same with a well known plugin..
acts_as_versioned.
A migration such as the one below (taken from acts_as_versioned) is
giving the error
undefined method `create_versioned_table'' for
#<ActiveRecord::ConnectionAdapters::MysqlAdapter:0xb74a1d44>
What the hell is that about? create_versioned_table is a definition of
Post.. not bloody SqlAdapter whatever.
Ideas?
Thanks
-henry
# class AddVersions < ActiveRecord::Migration
# def self.u...
2006 Mar 20
3
help: acts_as_versioned setup error "undefined local variable or method ''base_class''"
...s Recipies book. I''ve taken the following steps (nearly
verbatim) as mentioned by the book:
- created the target model "Post"
- added the "acts_as_versioned" label to the model file
- generated a migration file
- added the table creation code and the command "Post.create_versioned_table"
to the migration file
- ran "rake migrate"
What I got is the error "undefined local variable or method ''base_class'' for
Post:Class". I tried with other models and kept getting the same error. It
seems like "rake migrate" is missing the right...
2006 Feb 11
2
Migrations and Unintialized Constants Error
...:
create_table :notes do |t|
t.column :id, :integer
t.column :noteshare_id, :integer
t.column :title, :string
t.column :covered, :string
t.column :content, :text
t.column :created_at, :datetime
t.column :updated_at, :datetime
end
Note.create_versioned_table
The same thing happens with:
create_table :faculties do |t|
t.column :id, :integer
t.column :school_id, :integer
t.column :name, :string
t.column :created_at, :datetime
t.column :updated_at, :datetime
end
Faculty.create :school_id => 1, :name =...
2006 Feb 14
10
acts_as_versioned and getting authors
...t.column :id, :integer
t.column :noteshare_id, :integer
t.column :user_id, :integer
t.column :title, :string
t.column :content, :text
t.column :created_at, :datetime
t.column :updated_at, :datetime
t.column :version, :integer
end
Note.create_versioned_table
Now I want to be able to do:
<% @notes.versions.each do |version| %>
<%= version.user.fullname %><br/>
<% end %>
But I can''t!
User is not associated with versions. How can I associate it?
Thanks for your help :-). This has been bugging me for a long ti...
2006 May 06
0
Issues using GUID plugin: IDs and acts_as_versioned
...the ID with string
quotations. I get an error like:
Mysql::Error: Unknown column ''ayMi4o3iyr2OYfabBlKsEs'' in ''where clause'':
SELECT * FROM littles WHERE (big_id = ayMi4o3iyr2OYfabBlKsEs) ORDER BY
position DESC LIMIT 1
ISSUE #2) acts_as_versioned method "create_versioned_tables" assumes integer
for the foreign key id of the table to be versioned
Example: (using the same class as above) It will generate a "big_versions"
table with:
- id int (this is fine)
- big_id int (this should be a string since tables "bigs" has an ID that is
a string)
Ques...
2006 Aug 13
3
+ migrations in camping
...:Models
def self.schema(&block)
@@schema = block if block_given?
@@schema
end
end
Tepee::Models.schema do
create_table :tepee_pages, :force => true do |t|
t.column :title, :string, :limit => 255
t.column :body, :text
end
Tepee::Models::Page.create_versioned_table
end
The `schema` block describes how to create the tables that Tepee needs.
Yeah, this is in the Tepee sample wiki that comes with Camping. ActiveRecord is
used to create the tables, it runs once and it''s done. But what happens if the
next version of Tepee adds a field? Well, you wr...
2006 May 17
0
acts_as_versioned with lock_version bug?
...class CreateTables < ActiveRecord::Migration
def self.up
create_table :softwares, :force => true do |t|
t.column :name, :string, :limit => 20, :null => false
t.column :version, :integer, :default => 0, :null => false
end
Software.create_versioned_table
end
def self.down
drop_table :softwares
Software.drop_versioned_table
end
end
% rake migrate
(in /home/krassi/MyProjects/Rails/pl2)
== CreateTables: migrating
====================================================
-- create_table(:softwares, {:...