Displaying 20 results from an estimated 1000 matches similar to: "Legacy database problem"
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:
2008 Nov 14
3
migration with data
Hi
I am using postgres and have two migration files like
001_create_categories.rb as
class CreateCategories < ActiveRecord::Migration
def self.up
create_table :categories do |t|
t.column :name, :string, :limit=>80
end
end
def self.down
drop_table :categories
end
end
and 002_populate_categories.rb
class PopulateCategories < ActiveRecord::Migration
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:
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`,
2017 Nov 13
4
How to objcopy via LLVM toolchain for armv7e-m ELF32LE?
Hi LLVM developers,
As PR35281 mentioned:
$ llvm-objcopy -O binary llvm-cortex-m7.elf llvm-cortex-m7.bin
llvm-objcopy: 'llvm-cortex-m7.elf': The file was not recognized as a
valid object file.
if (ELFObjectFile<ELF64LE> *o =
dyn_cast<ELFObjectFile<ELF64LE>>(&Binary))
https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/llvm-objcopy.cpp#L200
2005 Dec 22
3
foreign_key setting ignored
I''m having a spot of bother creating a ''has_many'' relationship between
two legacy database tables. The relationship is ''company'' table has many
linked records in the ''contact'' table. Iv''e used ''generate scaffold'' on
these tables and everything is fine. I then decided to define the
relationship in the
2006 May 15
8
set_table_name and self.table_name
I have some legacy tables that I used set_table_name on, I''m attempting
to write a method that will get key value from a sequence table and then
update it and return a value. I''m hoping to put this in the base
ActiveRecord method so I would like to reference the table name with
self.table_name or something...
class Contacts < ActiveRecord::Base
set_table_name
2006 Aug 01
1
Legacy Pluralized Table Names
I am connecting to a legacy DB that has some names plural and some not.
I have configured:
ActiveRecord::Base.pluralize_table_names = false
now when i make a table that has an s on the end, it truncates the s.
example:
Table name: foo_bars
Rails command: ruby script/generate FooBars
Response (localhost:3000/FooBars): uninitialized constant FooBar
It works fine with non-pluralized
2006 Jan 20
4
Prepending table names on a per user or sub domain basis
Here is a sample of the database structure I want to have:
someclientname-websites
someclientname-canned_responses
someclientname-canned_responses_websites
anotherclientname-websites
anotherclientname-canned_responses
anotherclientname-canned_responses_websites
As you can see I want to prepend the name of my future clients to the
table name so that they use completely different sets of data.
I
2005 Dec 28
5
simple scaffold question
How do I get scaffold to generate code for a table whos name is not plural
of the modelname I give to it. I.E., If I have an existing database, and
wish to generate scaffold code for existing tables, is this possible???
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
2006 May 15
1
Does Anyone know how to set the table name as "CR_Country" ?
One issue is there in connecting one schema(table) "CR_Country" and
"CR_Security" from this sybase Db.
I have set false for pluralize_table_name and also setting the table
name explicitly too as follow in the "environment.rb" :
======================================
ActiveRecord::Base.pluralize_table_names = false
class CR_Country < ActiveRecord::Base
2006 May 08
4
Tables names with model classes in seperate modules
I have a module that deals with content pages and categories in my
application so create following tables:
content_pages
content_categories
Obviously I need a Page and Category module to map to these tables, but
in order to avoid conflicts with other Category classes, i declare my
model classes like this:
Content::Page
Content::Category
Now, that''s all fine - except that my models
2006 Jun 03
1
legacy support: removing underscore from table name.
I am using ms sql server and want to configure RoR such that it does not
convert the given table name (example: rubyonrails) to ruby_on_rails.
I set @@pluralize_table_names = false, so that it does not pluralize
the table names but cannot find the config setting which will force it
not to put underscore between words in a table name.
thanks in advance,
--
avinash
--
Posted via
2006 May 15
2
retrieving hashes key & values (ASAP)
Hi,
I want to retrieve the set of key & values which returns from a
stored procedure : connection.select_all "exec common.dbo.scr_lookupric
''AAP.N'' ".
The results i want to display in a view screen call result.rhtml.
Please help me out ASAP.
Thanks in advance.
joshua...
--
Posted via http://www.ruby-forum.com/.
2006 Mar 03
0
AR::Base.pluralize_table_names doesnt work with scaffold generator, right?
Hi!
The script/generator scaffold for models doesnt respect (source in) this
config/environment.rb setup, right?
Because I can put in there ActiveRecord::Base.pluralize_table_names =
false but when I run a command like
ruby script/generate scaffold model Something
then it throws an error saying that my database scheme doesnt have a
Something. However there is a table called something.
If I
2006 Jul 22
3
Extend dynamically a model
Hello,
I''ve a model defined as
class Account < ActiveRecord::Base
end
This maps a mysql table Accounts. I want to be a able to dynamically
change this model. During the life of my app, the table Accounts may
change name, how do I do a set_table_name not within account.rb?
--
Posted via http://www.ruby-forum.com/.
2006 Mar 25
4
dynamic set_table_name for achives
How can I pass something to set_table_name so that I can switch tables
on the fly for accessing archive data?
If I could access sessions inside a model I would do something like:
if @session[:current_period]
set_table_name "statistics_" + @session[:archive_year]
else
set_table_name "statistics_" + Date.now.year
end
But since I cannot access the session from within a
2006 Mar 27
1
Naming Convemtion for Model????
Hi,
In My database there is a table called "categories". Now what name
should I specify for my model as per ruby naming convention? Is it
"Category"???
Also is it possible to keep database table name singular instead of
plural?
Please tell me.
Thanx in advance.
Prash
--
Posted via http://www.ruby-forum.com/.