similar to: [PATCH] Access to more Arel predicate types from where condition hash

Displaying 20 results from an estimated 1000 matches similar to: "[PATCH] Access to more Arel predicate types from where condition hash"

2011 Feb 08
4
Remove ActiveRecord::Relation#& alias for 'merge' ? (or at least only reference and not use in AR)
Would the core team be open to the removal of the ''&'' alias for ActiveRecord::Relation#merge? The reason is that in Ruby the ''&'' operator refers to an intersection of two sets of data, not a merge. (within the context of the Array class) Recently Arel added support for SQL Set Operators: 2-0-stable:
2010 Aug 05
3
how to ? Rails 3 ActiveRecord eager loading and AREL
Hello everyone, I would like to eager load scoped records to avoid queries executed in a loop (huge performance impact). The "scoped" part is what is giving me a hard time. I''m using Rails3 RC. Does anyone have any idea how I can do it? Here is a test case : we have an "Article" and a "Comment" Activerecord models, article has many comments comment
2010 Jul 08
25
Prepared SQL statements
Dear all great developers. I wonder if there is any work being done or thoughts being shared regarding prepared SQL statements. Currently I am in heavy need of tuning SQL INSERTS that insert large (3MB) images into blobs. I am using rails 2.3.5 with postgres adapter and pg driver. Any information would be appreciated. Jarl -- You received this message because you are subscribed to the
2010 Jul 26
2
Exception Pages when behind a proxy
I am not sure if this desired feature or not but when we are behind a local proxy ie. Nginx/Varnish then the new ShowException middleware doesn''t seem to properly detect the remote IP address and it appears as if every browser gets a local error page with a stack trace, etc. I''ve opened up a ticket on the rails bug tracker but I also would like to verify that this is in fact a
2010 Sep 08
1
Unintended side-effect from before_remove_const?
Hey all, In troubleshooting a failing test for MetaSearch against 3-0-stable, I came across some undesirable (from my side, anyway) behavior in http://github.com/rails/rails/commit/bf87528b53f1422708ec0188d126cfca824ddc5c. A simple one-liner, it would appear, but AR::Base implements before_remove_const to do a bit of scoped method cleanup... It''s the only thing I can see that might
2012 Jan 03
1
Can Arel handle UPPER and LIKE condition?
Hello all, I''ve recently been on a project where somewhere needs using case insensitive search(using UPPER(name) LIKE '''') and LIKE condition, I want to use arel and don''t use the old style string concatenation, can arel handle this? But I check on arel documentation, doesn''t seems have any upper/like operator, and check on arel source, under
2011 Apr 10
0
Arel Union does not support #order or #limit
I just posted this ticket in Lighthouse, but thought perhaps some discussion here would help point me in the right direction toward a solution. Here is a description of the problem (from the ticket - https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/6693-arel-union-does-not-support-order-or-limit) : > If we take two `ActiveRecord::Relations` and join them via `union`:
2011 May 11
2
Issue with Arel::SelectManager and insert Method
Hello, Arel::SelectManager (arel 2.0.9) uses following statement to insert a new record: @engine.connection.insert im.to_sql, ''AREL'', primary_key_name, primary_key_value But in DatabaseStatements insert ist defined as: insert(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) Actually, Arel::SelectManager does not use the sequence name. This leads to issues
2012 Apr 17
6
ActiveRecord with different Date/Time format
I have an application where user sets his/her preferred date/time format. User is expected to enter datetime in his preferred format across the application. Now the problem is for few formats the datetime is parsed wrongly while create/update ActiveRecord. For example user has set date/time format in hh:mm dd/MM/yyyy. Now if user enters 17:00 04/05/2012 it parses it as 5 PM 5 Apr, 2012 where it
2011 Apr 18
12
Arel - clone bug (and fix), feature requests
Hi all, I''ve been playing around with Arel this week (actually outside of Rails) and found an issue with the clone implementation. I''ve added a patch and a testcase here: https://github.com/codders/arel/commit/660f706491ac012cb133554cffeaa6b9ae6046e9 and made a pull request against the rails/arel repo. I''ve also been playing around with support for ordering on
2006 Apr 20
5
acts_as_taggable patch 3866 needs some testing
DHH''s acts_as_taggable is now much more usable with this patch. http://dev.rubyonrails.org/ticket/3866 This patch adds scoped finders, documentation, and tests: # Get tags for all articles in a blog @blog.articles.tags # Get tags for articles in a blog published in the last year @blog.articles.tags :conditions => [''published_at > ?'', 1.year.ago] # Get related
2006 Nov 06
2
comparing 2 dataframes
Een ingesloten tekst met niet-gespecificeerde tekenset is van het bericht gescrubt ... Naam: niet beschikbaar Url: https://stat.ethz.ch/pipermail/r-help/attachments/20061106/756382a8/attachment.pl
2008 Jul 30
2
Mysql "lock wait timeout" tuning
We''re seeing these errors intermittently: ### Mysql::Error: Lock wait timeout exceeded; try restarting transaction: UPDATE `chairs` SET `published_at` = NULL, `updated_at` = ''2008-07-30 15:31:05'' WHERE `id` = 2147 [RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/ connection_adapters/abstract_adapter.rb:147:in `log'' ### The root issue is probably
2010 Oct 25
1
A few fixes to eager loading issues
Hey all, I''d really appreciate some eyes on https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5845-activerecord-3-eager-loading-fail#ticket-5845-19. There''s a small issue in Rails 3 eager loading, and this ticket has an accompanying patch. Sssociations that show up twice in a Relation chain like: Article.includes(:comments).includes(:comments =>
2006 May 27
0
Typo 1055 created_at Vs. published_at
[Couldn''t post this to the Typo forum, hope it''s Ok here :-)] Before I go off and create a Typo ticket, I''d like to know if anyone else is experiencing this and what there thoughts might be on the subject? In Typo 1055, if you use the admin interface and change the published date for an article, you will get "post not found", when you click on the article
2009 Jul 28
1
Rails date conversion
The environment.rb file in a Rails 2.3.2 app says: > Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. Auto-convert to this zone... when? Also, what are the differences between these two statements? config.time_zone = xxx config.active_record.default_timezone = xxx I ask these questions because I have a scenario whereby an AR-backed object, when
2007 Nov 29
4
collection.build or collection.create gives "ArgumentError: wrong number of arguments (1 for 0)"
I have a Project that has_many Tasks. Tasks belongs to a Project. When I try the following: project = Project.new project.tasks.build I get: >> s = Project.new => #<Project:0x25f9e28 @attributes={"name"=>"", "end_at"=>nil, "updated_at"=>nil, "published_at"=>nil, "user_id"=>nil,
2006 Jul 24
7
[PATCH] Support for DB Clusters/Replication in ActiveRecord (RFC)
Skipped content of type multipart/alternative-------------- next part -------------- Index: connection_adapters/abstract/connection_specification.rb =================================================================== --- connection_adapters/abstract/connection_specification.rb (revision 4617) +++ connection_adapters/abstract/connection_specification.rb (working copy) @@ -1,10 +1,21 @@ require
2011 Nov 22
4
A "strict Arel" mode for ActiveRecord to prevent SQL injection vulnerabilities
Hello rubyonrails-core, I’ve been looking into possible changes to ActiveRecord / Arel to make it easier to write Rails applications that are free of SQL injection vulnerabilities, and in particular do so in a way that makes it easy for a code reviewer to verify that the app is safe from such bugs. The concern: ----------------- With the ActiveRecord API as is, it’s relatively easy to write
2011 Feb 05
3
ActiveModel::AttributeMethods limiting
In my attempt to add AM:Dirty to my model I realized that AM#AttributeMethods is a bit imperfect. It''s impossible to generate attribute methods step-by-step in DataMapper-like manner. class Model include ActiveModel::Dirty def self.property(name, klass = String) define_property_accessors(name, klass) # This method will be called once, because of