similar to: How to configure every (postgresql) db connection?

Displaying 20 results from an estimated 700 matches similar to: "How to configure every (postgresql) db connection?"

2009 Sep 25
3
how to time out a query
Hi, I''ve got an activerecord query which takes longer than 100 seconds. I''m using rails 2.2 with postgresql 8.3. http://www.postgresql.org/docs/8.3/static/runtime-config-client.html mentions an option called "statement_timeout" which when set aborts a query which takes longer than x milli seconds. How do I pass this option to AR so that it in turn passes this to
2007 Aug 21
3
Eager Loading
is there a way to always eagerly load an associated object so that you don''t have to put :include into every finder? class Product <ActiveRecord::Base belongs_to :user #always load user when product is loaded end Product.find(1).user.login #1 query since user was loaded with the product, same as if i used :include but I don''t want to have to specify it everywhere.
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 Aug 10
3
ActiveRecord::UnknownAttributeError: unknown attribute: <script type
Has anyone seen this happening to their apps? I''m starting to get errors like this come across from one of my apps: ActiveRecord::UnknownAttributeError: unknown attribute: <script type The parameters being sent are: {"user"=> {"email_confirmation"=>"someone-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org",
2006 May 03
3
My Tooltips contribution
All -- I've been working on a simple tooltip widget and thought I'd release it into the wild. It builds on the features found in Prototype 1.5.0 RC0 and Scriptaculous 1.6.1. Very basically, it walks down a list of links and if they have id, href and title attributes, displays a tooltip on mouseover. Styled with a few lines of CSS and background images. You can demo it here:
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
2013 Jun 14
0
Support for deferrable constraints in PostgreSQLAdapter#disable_referential_integrity
I recently submitted a pull-request (https://github.com/rails/rails/pull/10939) to address a bug in PostgreSQLAdapter#disable_referential_integrity related to how the existing code behaves in a transaction when the PostgreSQL user account lacks superuser privileges on the PostgreSQL instance. While this permits the code to function without crashing, it doesn''t actually make
2006 Aug 17
2
validates_associated bug?
i seem to be experiencing a bug where rails tells me that my organization object''s associated credit card is invalid (activerecord validation-wise invalid), when i know it to be valid. this happens only if i tell the organization to validate_associated :credit_card. i know the associated credit card is valid, because a) that credit_card object itself throws no validation errors, and b)
2006 Mar 20
2
Rails Plugin to Help Debug Views
Hi, I just released a plugin to help debug views. The plugin makes it easy to add a button that will popup a new window that displays the following debug data; * Request Parameters * Session Variables * Flash Variables * Assigned Template Variables It was derived from code that traces back to Marten Veldthuis in Epilog. You can check out webpage and plugin via;
2010 Jun 30
0
I have problem ....PostgreSQLAdapter::PGconn
I have a problem when i am creating a rails project using postgresql... uninitialized constant ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::PGconn I have already installed gem postgres-pr. but not start.. I using rails version 2.3.5 Ruby 1.8.7 PostgresSQL 1.10.2. Please help me thanks. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to
2011 Jun 10
2
[LLVMdev] [VMKit] Bug in J3 User.Name detection
Hello List, I'm currently trying to compile VMKit for the L4 Operating System and the L4Re Runtime environment for my student project. While doing so I stumbled upon a bug in the implementation of lib/J3/Classpath/ClasspathVMSystemProperties.inc The current version first tries to get the username by checking the LOGNAME environment variable. If this is NULL it then checks tmp =
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
2006 Jan 19
2
Easy way to handle form input without a model class?
I have a couple forms that I''d like to be able to validate and automatically populate, but it shouldn''t be based on AR. In fact I often have a bunch of small forms that I can''t really justify writing a whole new model class for anyway. I''d like to validate the form input, and then use rails helpers to automatically populate the form if validations fail.
2008 May 01
5
Changing text in view with variables
in my view: <% if @main_singer_1 == @your_singer %> <% if @main_drummer_1 == @your_drummer %> i want to have this in a loop so i can change _1 How would I do this. I have some idea but I am not sure. [1..20].each do ..... and then replace _1 with each of the numbers or if someone can show the code to do this. number = "1" <% if
2006 Aug 08
2
Problem with plurals, migrations?
Hi, Ruby 1.8.4 Rails 1.1.4 Windows XP Pro I''m hitting an issue with migrations that I suspect relates to pluralization. Here''s the migration: class Hardware < ActiveRecord::Migration def self.up create_table :hardware do |h| h.column :vendor, :string, :limit => 32 h.column :model, :string, :limit => 32 end
2007 Mar 18
7
How to get more informations about an association at runtime
Hi all I''m working on a Custom Formbuilder. I want it to create me with a single method call checkboxes for a given HABTM association. My model looks like this: [code=ruby]class Member < ActiveRecord::Base has_and_belongs_to_many :preferred_music_styles, :class_name => ''MusicStyle'', :join_table =>
2007 Apr 06
3
@ vs self in models?
i''ve seen both of these syntaxes before and have also used both in my own models: class Foo def get_bar @bar end end and class Foo def get_bar self.bar end end seemingly with no difference... i''m a nuby though so could anyone enlighten me to the differences if there are any? thanks, jeff --~--~---------~--~----~------------~-------~--~----~ You received
2010 Mar 28
3
ActionController::UnknownHttpMethod: ***, accepted HTTP methods are get, head, put, post, delete, and options
I''m occasionally getting exception notices with this error message: ActionController::UnknownHttpMethod: ***, accepted HTTP methods are get, head, put, post, delete, and options Anyone ever seen this or know what could be causing it? Thanks, Jeff -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this
2010 Aug 18
2
RSpec 2/Rails 3 - content_for in view specs
My main layout includes separate content_for/yield sections for my header, sidebar, footer, and content. However, when running a view spec, the `rendered` variable seems to only contain a string of just the primary content and ignores the header/footer/sidebar as well as the rest of my layout file (the "render" call just returns my primary content wrapped in generic <html> and
2005 Mar 09
9
Unit testing + instance variables
After *much* digging and playing around, I finally figured out how to unit test instance variables that are created by actions. It was more difficult than I expected. It seems like there should have been a more straight forward way to do this. Can someone enlighten me? A simplified and somewhat contrived example of what I am current doing: Thanks. Matt >> # My Controller of interest