Displaying 20 results from an estimated 11000 matches similar to: "super() inside quote() of database adapters"
2009 Sep 08
2
Rails + Sybase ASE : group effort, please
Here''s what I have:
Ruby 1.8.7
Rails 2.3.3 (activerecord 2.3.3, etc)
activerecord-sybase-adapter ( http://itsignals.cascadia.com.au/?p=23 )
Here is the base code (login info was changed to protect me)
require ''rubygems''
require ''activerecord''
a = ActiveRecord::Base.establish_connection(
:adapter => "sybase",
:host =>
2007 Jul 30
3
validates_uniqueness_of doesn't work if value tested is numeric and column is string
Hello all,
I am working through the depot example in the rails book. If I add a
validates_uniqueness_of to a string column in the model, and then try
to create a record with a number in this string column I get an SQL
error. Looks like the SQL generated to test for uniqueness does not
quote the value if it''s numeric even though it''s comparing against a
varchar column. It does
2007 Oct 08
1
How to get database adapter type programmatically in rails?
Hi,all
I am developing a Rails application supporting both Mysql and Oracle.
I have to use Native SQL statements some place. While we know the SQL
grammar is quite different for Mysql and Oracle, so I have to get
database adapter type programmatically in my codes to process
different native SQL statements. I haven''t found any document for this
situation. After some research, I have found
2010 Apr 28
1
Trying to get Rails working with Sybase ASE
Hi
I''m trying to use the activerecord-sybase-adapter to be able to use ASE with
my rails applications.
But, I am struggling...
I followed (most of) the steps on this informative page:
http://trevoke.net/blog/2009/09/11/connecting-to-sybase-with-rails-on-windows-xp/
Initially I had Rails 2.3.5 installed.
I copied the "Ruby Sybase files" as instructed and the Sybase dll files
2006 Jan 13
1
How to disconnect to a database????
Hi,
We have experienced some problems with
ActiveRecord::Base class of Ruby-Rails. We are
building a web-application based on the Ruby-rails
framework and the web-application needs to access to
difference databases, so we do not pre-define our
database accesses in the database.yml file. In fact,
we are using the
ActiveRecord::Base.establish_connection() to connect
to our database, the function
2007 Apr 03
0
[Sybase Adaptor] find_by_xxx does not work correctly.
Hi
Please advice me about the following problem.
* Problem
find_by_xxx method does not work correctly the following caes with
sybase adaptor.
* How to reproducible
model :users
t.column :code, :string <-- :string column
t.column :last_name, :string
t.column :first_name,:string
>> User.find(1)
=> #<User:0x2abe232a68e8
2009 Aug 28
0
Error connecting to Sybase (odd)
I have activerecord-sybase-adapter installed -- and Sybase itself, so I
have the drivers.
In irb or in the rails console, this works:
ActiveRecord::Base.establish_connection(
:adapter => “sybase”,
:database => “mydb”,
:host => “myhost”,
:myport => myport,
:username => “read_only”,
:password => “read_only”)
In Rails, I have this in my database.yml:
pacs:
adapter: sybase
2005 Apr 23
2
[Tip] Introspection to determine if a column may be null
I still want to get this into Rails for all connection adaptors, but
for now I''ve hacked my own addition on for just PostgreSQL.
The following code extends every Column object returned by
MyModel.columns to support a new #required? method, which indicates if
the column may or may not be null.
The following is a huge hack - suggestions on a cleaner way to add this
functionality
2006 Apr 18
1
Custom Database adapters
Hi. I''ve created a custom database adapter, but I''d like to modify the
RAILS_CONNECTION_ADAPTERS variable, and add the adapter in my rails app
rather than modifying the activerecord directory.
Does anyone know how to do this, or can point me to info online? Thank
you.
--Aaron
2006 Aug 16
0
How to reconnect to the database?
I have a rails app that uses a background process. Every now and then,
for a reason beyond me, it will say "Product id=7 not found". When the
product is in the DB. So What I''d like to do is catch that exception and
then reconnect to the database. Hwo do I do this? I saw a reconnect!
method, but I have no idea which object to run that on how how to
actually use it.
Here is
2006 Jan 18
1
Helps!!!!! Rails database connection guru needed!!!!!!!
Hi,
I really need help to understand what is happening
while Rails connect to a database, (we area actually
using postgresql, so my example will be with
postgresql) What I understand is Rails is able to
connect to different DB. Actually, this is what we
want, and we have made some tests, everything is juste
fine. However, all these tests lead us to some
important questions that we did find the
2006 Aug 02
2
mangle ActiveRecord
Dear Gurus on Rails!
How do I change the behaviour of one method in
ActiveRecord::ConnectionAdapters::SchemaStatements ?
Full story:
I''d like to mangle
ActiveRecord::ConnectionAdapters::SchemaStatements
so when it creates a new sql table, it also (optionally) creates my
created_at, deleted, key_id, session_id etc columns that I use on basically
all tables.
It would not be DRY to repeat
2008 Jan 16
0
[CruiseControl] RubyOnRails build 8649 failed
The build failed.
CHANGES
-------
Revision 8649 committed by gbuesing on 2008-01-16 20:07:10
Introducing DateTime #utc, #utc? and #utc_offset, for duck-typing compatibility with Time. Closes #10002
M /trunk/activesupport/CHANGELOG
M /trunk/activesupport/lib/active_support/core_ext/date_time/calculations.rb
M /trunk/activesupport/test/core_ext/date_time_ext_test.rb
TEST FAILURES AND
2010 May 28
2
Suggestion for improving value_to_boolean column conversion
Hi fantastic rails core developers.
Speaking of version 2.3.5:
I find it rather error_prone that values such that "some text" is
silently converted to false when stored in a boolean DB field.
Among other things it means that assign "some text" to boolean fields
on a model will not generate any validation messages (it will silently
be converted to false).
I think it is like
2008 Jan 04
2
oracle adapter + activerecord sessions do not work
Anyone know what''s up with the activerecord session store when using
the oracle adapter in Rails 2.0.2 ?
I can set a session variable and can then see it''s actually set using
the debugger, but after the request completes the session is empty
(the @data member is nil). The session_id is staying the same and the
updated_at field is being updated but nothing I put in a session
2009 Oct 14
18
sybase in rails2?
Has anyone actually gotten the activerecord-sybase-adapter to work in
Rails2?
I can''t seem to, and can''t figure out why. I am on RedHat linux.
I have the sybase client libraries installed, I have the adapter
installed. After installing the patch at
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2455-update-for-sybase_adapter#ticket-2455-4
to get a slightly
2006 Apr 25
0
Migrate default now()
I want to set default value to current time of database:
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
# ...
t.column :created_at, :timestamp, :null => false, :default => ''now''
end
end
#...
end
On postgresql, it is converted to:
created_at timestamp NOT NULL DEFAULT ''2006-04-25
2008 Mar 20
0
Mixing stored procedure call with RoR db calls in the same function gives errors
Folks,
I am using ruby 1.8.5 with rails 1.2.3 and have made changes to
mysql_adapter.rb based on recommendations made here
http://wiki.rubyonrails.org/rails/pages/StoredProceduresInMySql to be
able to use stored procs in my code.
I have changed this call in mysql_adapter.rb
ConnectionAdapters::MysqlAdapter.new(mysql, logger, [host, username,
password, database, port, socket], config)
to
2008 Jun 24
9
ActiveRecord 2.1 Migration support
Hi all,
I am in the process of adding Migration support to the Ingres
ActiveRecord adapter and have run in to a problem. During the call to
create_table the Ingres adapter some how causes ruby to blow the stack
and coredump/segv. I have tracked down the problem down to
"add_column_options!" in
"lib/active_record/connection_adapters/abstract/schema_statements.rb".
2008 Jun 24
9
ActiveRecord 2.1 Migration support
Hi all,
I am in the process of adding Migration support to the Ingres
ActiveRecord adapter and have run in to a problem. During the call to
create_table the Ingres adapter some how causes ruby to blow the stack
and coredump/segv. I have tracked down the problem down to
"add_column_options!" in
"lib/active_record/connection_adapters/abstract/schema_statements.rb".