similar to: migration with data

Displaying 20 results from an estimated 300 matches similar to: "migration with data"

2006 May 11
4
Legacy database problem
Hi I am trying to use Ruby on Rails to work with an existing database. The problem is that, all the table names begin with a captial letter (e.g. Products). So I did the following changes in environment.rb, I''ve added under # Include your application configuration below ActiveRecord::Base.pluralize_table_names = false In class Product, I''ve added set_table_name
2006 Sep 01
2
Mrelation does not exists
Hello! I''m having the following error: RuntimeError: ERROR C42P01 Mrelation "subjects_users_id_seq" does not exist Fnamespace.c L200 RRangeVarGetRelid: SELECT currval (''subjects_users_id_seq'') when I try to do: subject= SubjectsUser.new(params[:subjects_user]) subject.save The models: class User < ActiveRecord::Base has_one :last_entrie has_one
2006 Aug 08
2
Testing Inconsistencies - ruby works rake fails
I''m getting some very weird results when testing my system. If I run my unit tests using => ruby \test\unit\<filename.rb> each of the tests pass. If I run => rake test_units I get several failures, and they all have to deal with the same issue. For instance I''m getting => ActiveRecord::StatementInvalid: RuntimeError: ERROR C42P01 Mrelation
2006 Jul 20
4
Help with Rails and postgres with sequence numbers (global?)
Hello, I am building an Rails applications that has to integrate an legacy system (lxoffice) (schema at: http://www.lx-office.org/uploads/media/DB_Schema_2.1.1_R_393_17_03_2005_.pdf). They somehow use global ids (global for some tables). I can not change the schema and still I want to use Rails to access it and not pure SQL. When I try to insert a record I get the following message:
2006 May 28
3
Working with topics and categories
Hello guys, I''m a newbie in RoR and I have a problem. My DB structure is ====================================== topics table : id(int,11) name(varchar,255) categories : id (int,11) topic_id(varchar,255) name(varchar,255) ====================================== --Models:-- class Topic < ActiveRecord::Base has_many :categories end class
2008 Apr 01
1
Navigation Problems
Hi, I am having problems with my page. I have a banner and navigation bar in controller_name.rhtml in app/views/layout. Can someone please help? Thanks In the navigation bar, I have the following links: Category1 Sub-Category1 Sub-Category2 Sub-Category3 Sub-Category4 Sub-Category5 Sub-Category6 In the main content, I have the following links: Sub-Category1 edit delete
2006 May 12
0
Using primary key that is not named "id"
Hi I am using a legacy database that the primary key is named "ProductID" and its type is SERIAL (or INT NOT NULL auto_increment). set_primary_key "ProductID", is added to the Product class Then I used >ruby script/generate scaffold Product Admin to generate my controllers. When I try to insert a new product in the products table, it gave me this error RuntimeError:
2006 Jul 14
3
postgres migration notices
When I run "rake" using a postgres 8.1 database, I get a bunch of these notices. NOTICE: CREATE TABLE will create implicit sequence "categories_id_seq" for serial column "categories.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "categories_pkey" for table "categories" How can I avoid those? I take it I need to modify the
2008 May 19
2
x is not a number error??
I may be overlooking something really obvious here but I''m not getting it. I have a Category model. Categories can have sub categories and parent categories, but when a category doesn''t have a parent category, its "parent_categoryid" field is set to null. As far as I know, what I am doing here has been working in the past because there are many categories in my
2009 Aug 06
1
Using 'field names' of a data.frame in a function
I may be doing this wrong! but I have a function which I have simplified a lot below. I want to pass some 'field names' of a data-frame to the function for it to then do some manipulation of. Here's my code: #build a simple dataset mydataset = data.frame (
2007 Oct 18
4
Feeding the framework ?
Hi there, Is it just me or do many other rspec / rpsec_on_rails users spend more time than they would like feeding the framework ? Don''t get me wrong, I love rpsec, but I seem to spend about 2/3 hours per week hunting down rspec problems. For example, today `rake spec:models` is broken. When I migrate, load fixtures and run `spec -cfs` all is well. When I run `rake spec:models`,
2007 Feb 25
0
moving local files, remote mirroring, and --link-dest awkwardness
I have some pictures that I unload from the camera into: dir/tmp and at night I automatically rsync all of dir/ to some remote:dir/ Then days or weeks later I do some local sorting, and I make lots of image moves of the sort where image dir/tmp/bar goes to to dir/category1/bar, possibly linked also into dir/category2/bar. Then rsync runs the next night, notices the "new" image
2009 Jul 17
2
Count data categories from table
Hi there, I have a relatively simple question, though, I couldn't find a solution for it so far. I have a table with 1000 entries and columns containing information about different parameters for each entry. What I want to do is group all parameters from one of the columns [e.g. if all 1000 entries are grouped in 30 different categories (described as character strings) in a second column] and
2008 Dec 27
1
Want to create empty vectors inside a empty data frame
Hi All, I want to create empty vectors inside an empty data frame.The name of the vectors has to come dynamically. For example if record_mean is my empty data frame,and i have say 4 categories,the category names for record mean data frame has to recmeanC1,recmeanC2,recmeanC3,recmeanC4,which will be dynamically created and which will again be inserted in my data frame's as column values.Each
2010 May 25
2
Site Navigation With Polymorphic Has Many Through
Hi, seem to keep running into a wall here. I can''t find any resources on site navigation that can deal with any model being in the nav, allow nesting, and can dynamically update. So I thought about it for a while, and decided on a MenuItems class, which contained the position of the child in relation to it''s siblings, where the parent and the child were polymorphic. Then a given
2007 Oct 18
0
rake spec:models failing
Hi there, I''m having trouble with `rake spec:models`. It''s failing on: - 1 old rspec/rails project - all new rspec/rails projects But, it *is* working fine on my other (older) rspec/rails projects. All projects are on rspec & rails 1.0.8, Rails 1.2.3, os X ppc Here''s a fresh rspec/rails project with failing rake task $ rails test_app -d postgresql $ cd
2006 Jun 03
2
Parent listing children.
My database is set up as Categories > Things associated by category_id and has_many and belongs_to. How would I go about listing all the categories and under each Category is it''s children? Is there an easy rails way to do this - preferably without using acts as tree? Any help is appreciated - thanks! -- Posted via http://www.ruby-forum.com/.
2005 Nov 30
0
Passing variables with update_all
I''d like to produce an SQL update along the lines of: UPDATE companies SET category2={newcategory} WHERE (category2 = {oldcategory}) At the moment I''ve got: ctype = params[:ctype] Company.update_all("category2=ctype", "category2=ctype") At present this returns a StatementInvalid: Unknown column ''ctype'' in ''where clause'':
2009 Aug 06
13
Redirect after login
Hi, I''m new to Ruby/RoR so please bare with me! I''m trying to adapt a ruby setup where someone logs in to a bonjour service via a web browser. I have the login screen which asks for host and password. There is only one user per host and i can log in fine. It''s suppose to redirect me to /list in my browser but doesn''t. Once i''ve entered the correct
2009 Nov 12
9
uninitialized constant XML::Document
Hi All, I have installed "libxml-ruby" gem on my ruby instllation. while trying to create xml document with ruby progam in Rad Rails am getting error like "uninitialized constant XML::Document (NameError)" do i need to config any thing else in environment.rb file Thanks in advance Chinna. -- Posted via http://www.ruby-forum.com/.