similar to: Performance vs normalization best practice

Displaying 20 results from an estimated 1000 matches similar to: "Performance vs normalization best practice"

2006 Aug 24
10
MongrelCluster - How can I make a request to a specific mongrel instance?
In our app we''ve a number of singleton ruby classes that cache static data in hashes, things like string values, system config params, etc). In a webbrick environment this works ok, but we find in production we have a problem because we have 4 caches, one for each mongrel instance. This also isn''t a BIG problem, but our cache.reload() methods are kinda useless now, because we
2006 Jun 30
4
Strange behaviour from assert_redirected_to
I have this assertion in my tests: assert_redirected_to :controller => ''user'', :action => ''change_password'' It fails with: response is not a redirection to all of the options supplied (redirection is <"http://test.host/user/change_password">), difference: <{:controller=>"user"}> The redirection was: redirect_to
2006 Jan 06
4
"Selecting" a calculated row / Using :select in the paginate method
Hi, I was trying to use the :select parameter to select a calculated row, but it appears that the parameter is not picked up by the paginate method. I want to add the following to the select statement: timediff(now(), created_on) as age So I tried: @story_pages, @stories = paginate :stories, {:per_page => 10, :include => ''user'', :select =>
2013 Jul 23
1
Postgres adapter misconfigured on Linux?
I''ve written a simple Rails migration that adds an index to an existing Postgres table: class AddIndexToEvents < ActiveRecord::Migration > def change > add_index :sf_events, :account_id > end > end However, when I run the migration, it fails due to a syntax error on the CREATE INDEX line. I''m expecting some SQL like this to be generated: CREATE INDEX
2006 Jan 14
4
hide_action doesnot hide view
The view file (eg. apps/views/items/list.rhrml) is still displayed even when the action is hidden (hide_action :list). How can I hide view file form being automatically displayed in this circumstance? thanks, jigar -- Posted via http://www.ruby-forum.com/.
2006 Jul 29
6
Anyway for a model to call url_for?
Or better yet, a named route? Tried lots of searches and ugly hacks ... Thanks in advance.
2006 Jun 29
7
sql question for rails
Hi, i was hoping someone could help me out with a small yet quite time-boggling task...i have a two tables users, groups joined in as a habtam relashinship (has and belongs to many) and i need to select from the mydb (mysql if it matters) users out of the User model, in accordance with TWO groups in one rails opperation to improve performance...basicly, say i have ten groups and ten users,
2009 Sep 10
2
Problem Deleting IMAP Folders
Hello, In my configuration I have mail_location = maildir:/Mail/frank.gr/%n:INDEX=/Mail/frank.gr/ __Indexes/%u I can create new folders in an IMAP session, but when I try to delete I get permission denied. From the LOG Sep 10 13:20:06 IMAP(stuart): Error: unlink_directory(/Mail/frank.gr/ __Indexes/stuart/.TEST) failed: Permission denied ls -ald /Mail/frank.gr/__Indexes/stuart/.TEST
2006 Mar 14
7
Overriding new or create for a model
I have a model where I need to calculate one of the fields when I create a new instance. It seems to me that I should do this in the model code and that I should override the new and/or create methods. Is this the right approach and, if so, how can I execute the existing method but add on my calculation? I want something like: def create -Do the original create first- field =
2006 Jun 16
4
problem with join
Hi all, I''m having a problem with a join inside a paginate, the code is like this: @ruta_pages, @rutas = paginate :rutas, :conditions => conds_arr, :joins => "AS ru LEFT JOIN vehiculos AS ve ON ru.vehiculo_id = ve.id", :per_page => 10, :order => "fecha DESC" The problem with this, is that the query returns the
2006 Mar 22
10
Need for multiple acts_as_list
I have a model "Childmodel" that belongs_to two other models "Parent1" and "Parent2". "Parent1" "has_many :childmodels, :order => :positionp1" and "Parent2" "has_many :childmodels, :order => :positionp2". i.e. The child is independently positioned within each of its parents. This works fine and gets me the useful
2006 Jun 19
3
Using a records "id" in validation
I need to use an order''s id value in a validation. Basically, I am charging an order via a credit card API. I only want ot save the order if the credit card authorization was approved. I also want to send the order id to the credit card API as a transaction reference. And last but not least I want to add an error to the order object if the transaction is declined. The problem is
2006 Feb 07
17
Easy way of dealing with nil properties in templates?
Is there an easy way to deal with nil properties in templates? All I''m aware of are these methods, and it''s quite tedious and surely violates DRY. <%= @member.name unless @member.name.nil? %> <%= @member.name.to_is %> <%= "#{@member.name}" %> csn __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the
2006 Jun 26
4
has_many :through
first, the models: class Listing < ActiveRecord::Base has_many :keyword_links has_many :keywords, :through => :keyword_links, :conditions => "active = 1" end class Keyword < ActiveRecord::Base has_many :keyword_links has_many :listings, :through => :keyword_links, :conditions => "active = 1" end class KeywordLink < ActiveRecord::Base belongs_to
2006 Apr 25
2
Bug in Rails 1.1 implementation of before_filters
I just spent a few hours tracking down a bug in Rails 1.1, so I thought I''d post the issue and a workaround just in case anyone else hits it. I designed a security enhancement so that controller methods can be protected by preceding them with a role. The standard Ruby method_added() callback is used to detect when controller methods are added, and then I manipulate the
2007 Aug 22
4
DO NOT REPLY [Bug 4912] New: rsync crashes with a double free or corrupted memory detection in glibc
https://bugzilla.samba.org/show_bug.cgi?id=4912 Summary: rsync crashes with a double free or corrupted memory detection in glibc Product: rsync Version: 2.6.9 Platform: x86 OS/Version: Linux Status: NEW Severity: major Priority: P3 Component: core AssignedTo: wayned@samba.org
2008 Jan 18
6
Odd transfer speed issue
Hi all, I'm seeing slow transfers to/from my samba server. I just tried to copy a 270MB file from a samba share to an XP machine. At first, the estimated time displayed as 141 minutes :( The odd thing is that if I then flood-ping from the server (in this case, I pinged my dsl router), the transfer completes in about 10 seconds. Hitting F5 repeatedly when browsing a share on the server
2007 Jun 27
5
Filter Ordering in Edge Rails (Rev 7143)
Filter chaining appears to behave in differently than Rails 1.2.x. It seems that I''m getting a lot of errors along the lines of: ActionController::ActionControllerError: filter #<ActionController::Filters::ClassMethods::BeforeFilterProxy:0x322f468 @filter=#<ActionController::Filters::ClassMethods::SymbolFilter: 0x322f4b8 @filter=:login_required>> was in the wrong place!
2006 Jan 04
7
<% if ... -%> What is this?
I seen some RoR code that went like this: <% if ...blah, blah... -%> .. blah, blah <% end -%> What are the minus signs for in the if statement? Cannot seem to find anything about this, and searching on "-" in this context is hard to get anything meaningfull back. Thanks, - Mark -- Posted via http://www.ruby-forum.com/.
2005 Dec 30
6
call a method once per page request
Hi, I''m wondering if there is a simple solution to call a method once per page request. I tried to place my call in a before_filter in ApplicationController but it''d called a second time if I use render_component from a view. Seems to me that a hook should be added in Dispatcher#prepare_application. Context: working on i18n, I''m trying to check lang either from uri,