Displaying 20 results from an estimated 20 matches for "table_name_prefix".
2006 Apr 11
2
AR class names
hello all, quick question: how can I find out if a given string matches the
name of an ActiveRecord derived class?
thanks in advance
alan
2006 Jan 26
0
Bug with table_name_prefix?
Hi all,
I think I have found a bug in ActiveRecord''s handling of eager loading when
using table_name_prefix. Here is a reduction of the problem :
class Cheese < ActiveRecord::Base
##
## id SERIAL
## name VARCHAR(32)
## county_id INTEGER
##
belongs_to :county
def self.table_name_prefix
"stuff_"
end
end
class County < ActiveRecord::Ba...
2013 Mar 07
0
custom table_name for table users with devise
Hi
for my app, I have several tables for users (franceusers, belgiumusers,
...) and I would like to use one or another depending on domain
I tried with table_name_prefix and table_name but it seems to not work
class User < ActiveRecord::Base
rolify
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable, #:confirmable,...
2007 Jan 23
11
dynamic tablenames
Hi List!
May I tap into your combined common sense ?
I have a legacy logging app that needs to be modernized. At the moment,
Data is going to be stored in 5 tables, one table is going to contain
more than 200 million and 2 others about 60 million rows. Mysql will be
used, unless someone sees a major advantage in using something else (at
the moment data is stored in a raw positioned file format,
2011 May 29
4
Model load time
Hi, I''m getting a little confused how Rails handles loading models.
I''m on development mode, using Rails 3.1.0.rc1 on ruby 1.8.7
My application models are:
Curso
Legislacao
Usuario
And I have another model that is loaded from a gem Im trying to build:
Cidade
My gem is actually a simple engine:
require ''active_record''
require
2006 Aug 11
0
habtm in a standalone ruby script broken?
...ActiveRecord::Base
has_and_belongs_to_many :host_scheduled_downtimes
...
And in .../app/models/host_scheduled_downtime.rb:
class HostScheduledDowntime < ActiveRecord::Base
has_and_belongs_to_many :host_downtimes
...
this works fine, until i introduce a table_prefix with
ActiveRecord::Base.table_name_prefix = "devel_"
>From the database log i see that each tablename is correctly prefixed
with _devel, execept the join_table
host_downtimes_host_scheduled_downtimes
I included a printf stament in Associations::join_table_name and saw
that table_name_prefix was an empty string.
If i commen...
2007 Sep 05
8
Hi..Guys new plugin again
...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.redhillonrails.org/svn/trunk/vendor/plugins/fore...
2007 Jun 19
2
sequence name prefix
In Postgres, I use different database schemas for each application, by
declaring, e.g.:
class ApplicationController < ActionController::Base
ActiveRecord::Base.table_name_prefix = "keywords."
end
I assumed that the sequence names were also prefixed with the database
schema names, e.g.
keywords.things_id_seq
But Rails 1.2.3 assumes the sequence is *NOT* in the same schema as the
tables, and prefixes them with ''public.'' :-(
I have to declare i...
2008 Jul 05
4
one db - many rails projects -> many schema_migrations table
Hi all!
How can I change the name of the schema_migrations table? I have to do
this because I can only use one database but want to have several rails
projects.
I hope this is possible at all.
greets
flo schaf
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
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 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 Mar 29
38
Poll: Which distro do you use for Rails/Ruby development?
Good afternoon,
I''ve two quick questions for the Ruby/Rails community.
1) Do you use Linux for Ruby or Rails development?
2) If you use Linux, which distro do you normally use to develop?
Thank you for your input. :-)
--
Posted via http://www.ruby-forum.com/.
2007 Aug 07
4
Execute additional commands after creating database?
...ry to find models for the legacy tables. This worked fine so far. I
even got triggers working to be able to write into the real tables.
Now I installed RSpec and tried running some tests. This failed
because the test database gets recreated on every test run. Since I
specified config.active_record.table_name_prefix to be "rails." and a
fresh database doesn''t contain that schema yet it fails miserably. I
tried executing a "create schema rails" in the first migration but
somehow Globalize bit me in my ass because it tries to create it''s own
tables first although there is no...
2007 Feb 13
5
default database schema and relationships
hi everyone..
i''m a high school teacher who wrote a webapp in PHP and MySQL for my
curriculum.. i use it to keep attendance, take notes per student or
class and keep track of activities. i would like to soup it up and
have read both the pickax and version 2 of agile web dev...
now i''m starting to work and i''d like to rename columns and
relationships in the database so
2010 Mar 20
1
[PATCH] AR migration generator includes model's modules in table name. [#4230]
Hello! Could someone review the patch attached to [1] and provide
feedback?
Briefly, it targets rails 3, and fixes "rails g model admin/post".
The generated migration creates a "admin_posts" table while the model
expects a table simply named "posts". With the patch, the migration
creates "posts".
Thank you!
--phil--
[1]
2005 Oct 29
0
Re: Multiple rails instances, single database
...ge-ID:
> <9ec5d0aa0510290123i78bb039chdf220c0c6e89f9f7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
> Content-Type: text/plain; charset="iso-8859-1"
>
> http://wrath.rubyonrails.org/pipermail/rails/2004-December/000966.html
>
> Check out ActiveRecord''s table_name_prefix attribute....
>
> -lazy
>
> On 10/28/05, Peach <randompeach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >
> > I''m developing a rails application to aid in collaborative novel
> > writing. The application defines a world view and writers write their...
2011 Apr 15
2
sti + namespace
...weather_stations/noaa.rb
apps/models/weather_stations/cwop.rb
apps/models/weather_stations/wolfram.rb
... etc.
So: are there any special considerations in this approach? The docs
talk about namespacing models, and talk (briefly) about STI, but not
together. Do I have to do anything special with table_name_prefix or
descends_from_active_record? ?
I''ll set about trying this out as soon as I hit [submit], but I''d
appreciate a heads up if I''m headed for trouble!
TIA.
- ff
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the G...
2005 Mar 01
4
PostgreSQL Schema and Rails
Hey all,
I am curious about how Rails interacts with SCHEMAs in PostgreSQL. From
the generate command, is it possible to setup a scaffold for a table not
in the public. schema in PostgreSQL?
As a test, I tried,
./script/generate scaffold Manage.Form Manage.Form
No dice.
Any suggestions?
-Robby
--
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON
2007 Apr 04
4
joining across databases in a find statement with include (legacy db)
Hi,
I have a legacy database ''old'' and a new database ''new'' which rails
uses. I set up models using old with establish_connection(old), and
this works well, except for include:
class OldModel < ActiveRecord::Base
establish_connection(old)
end
class NewModel < ActiveRecord::Base
has_one :old_model
end
a = OldModel.find :first
NewModel.find(:all,
2006 Jan 03
22
Large-scale application
Hi fellow railers!
We are discussing the possibility of writing a very large application in
Rails. By "very large" I mean a framework that would contain a few
hundred smaller applications that would need to talk to one big database
and have to share some common session data I''d like to get some
feedback on some possible ways of doing the following:
The application would