Displaying 20 results from an estimated 30 matches for "pluralize_table_name".
Did you mean:
pluralize_table_names
2009 Mar 17
3
Disabel "pluralize_table_names" in Rails 2.3.2
What is it in Rails 2.3.2?
ActiveRecord::Base.pluralize_table_names = false
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@pu...
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 then change my something table to somethings and rerun the command,
then it work...
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 names, underscore or not.
Can i con...
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 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 http://www.ruby-forum.com/.
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 May 15
0
Automatically converted the table name to small letters!!
One issue is there in connecting one schema(table) "CR_Security" 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
set_table_name "CR_Country"
end.
=============================...
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
set_table_name "CR_Country"
end.
==============================...
2007 Sep 05
8
Hi..Guys new plugin again
...:order_lines. More specifically, the plugin removes the prefix
from has_many and has_one associations if the the name of parent class
forms a proper prefix of the child class name.
The plugin fully supports and understands the following active-record
configuration properties:
config.active_record.pluralize_table_names
config.active_record.table_name_prefix
config.active_record.table_name_suffix
Installation
EDGE
To install using SVN:
ruby script/plugin install svn://rubyforge.org/var/svn/redhillonrails/trunk/vendor/plugins/foreign_key_associations
or using HTTP:
ruby script/plugin install http://www.redhillo...
2005 Oct 25
2
generate scaffold ignores controller parameter
Since I upgraded from Rails 0.13.1 to 0.14.1 "generate scaffold <Model>
<Controller>" doesn''t take any notice of the controller parameter. Anyone
else suffering from this? E.g.:
C:\Ruby\work\test>ruby script\generate scaffold User Admin
exists app/controllers/
exists app/helpers/
create app/views/users
exists test/functional/
2005 Aug 06
2
Problem with 0.13.1 ActiveRecordStore with PG 8.0.3.
Hi,
I put the following in my environment.rb file:
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update
(:database_manager => CGI::Session::ActiveRecordStore)
Runnning WEBrick via "script/server" and trying to load any page
served by a controller results in an error like the following:
#<ActiveRecord::StatementInvalid: ERROR: null value in column "id"
2006 May 11
4
Legacy database problem
...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 "Products"
however, if I try to list all the elements in the Products table
(@products = Product.find(:all)) , I have the following error:
RuntimeError: ERROR C42P01 Mrelation "products" does not exist
Fnamespace....
2006 Jul 05
2
Serialized object behaves weird
Hi!
I got a class named EinsatzFilter which I serialized to session. Before
saving to session it works afterwards I keep getting the message:
"undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from
ActiveRecord::Base inherited class.
Code:
class EinsatzFilter
include ApplicationHelper
attr_reader :personen, :monat, :projekte, :kunde
2006 May 12
2
Pluralization of non-noun names
People,
I have an insurance company client and for the last eleven years I have
wanted to completely redevelop their system from scratch. However, the
boss has never been interested in hiring a team to develop the new
system (partly because of the cost and partly because of some famous and
expensive development failures in the industry) and has always insisted
on incremental development of the
2006 Jan 18
3
I need superman!
I have a legacy database that I can''t figure out. I''ve tried hundres of
times and spent way tooooo much time trying to figure this out. I don''t
think that rails can do it. Maybe there is a superman here who can get
this too work. I''m going to post my sql dump to produce a very simple
database. If anyone can get rails to work with this THEY WILL BE MY
2006 Apr 27
0
last stupid question today
...t; t2),
then I can access t2 in memory ala t1.predecessors[0]. but calling save on
t1 has no effect on
persisting the predecessor relationship and if I populate the join table
manually to create predecessors for t1,
t1.predecessors still returns [].
In my environment I have:
ActiveRecord::Base.pluralize_table_names = false
and in any case I''ve tried both :join_table => "predecessor" , and
:join_table => "predecessors" with the same result.
what am i doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pi...
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/.
2006 Feb 02
0
just a feedback
...e for your mode"
Even if the name of the table is matching the name of the model
specified in the command line
If you want to deactivate this behaviour, in case of testing RoRs with
your existing database, you must add in your environment.rb file the
following variable :
ActiveRecord::Base.pluralize_table_names = false
HM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060202/7c36661b/attachment-0001.html
2006 Jan 26
3
Problems with simple scaffold code
...ace is here:
http://rafb.net/paste/results/H87GHC68.html
Could you point me to what problem needs to be fixed please as i''ve been
banging my head against this for some time now?
The table is very simple and its called "user" with id, email, password
fields. I''ve set pluralize_table_names to false and set_table_name
''user''. That''s all i tweaked the rest is all scaffold''s fault ;-)
Ah yeah, my stack is winxp, ruby 1.8.2, rails 1.0, webrick, postgresql 8.1
The connection with the db certainly works otherwise generate/scaffold
would have generat...
2007 Jun 08
0
problem with rake db:sessions:clear and session_table_name
...od to set a custom table name in the database for
my sessions table.
This works fine however there''s a problem with the following rake tasks:
rake db:sessions:clear
rake db:sessions:create
in file: railties/lib/tasks/databases.rb
They instead use the state of
ActiveRecord::Base.pluralize_table_names to set the table mane to
either ''session'' or ''sessions''.
I started working on a patch but got confused figuring out where
table_name is defined in activerecord_store.rb.
It''s defined once as a cattr in this Class:
CGI::Session::ActiveRecordStore...