Displaying 20 results from an estimated 4000 matches similar to: "Merge scopes with OR"
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:
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
2011 May 05
9
[threadsafe] Arel ToSql visitor is not threadsafe
Hey,
We hit a bug today because Arel::Visitors::ToSql is not threadsafe.
Here is what is happening:
Arel::Visitors::ENGINE_VISITORS is a cache of visitors instances.
These instances are not inherently threadsafe because it contains
state ''@last_column'', ''@connection'' that is shared between threads.
The other variables ''@pool'',
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 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
2016 Jul 22
3
Old mailing list links broken.
Hi Tanya,
I was spelunking through bugzilla and ran into an old mailing list link
http://lists.cs.uiuc.edu/pipermail/llvmdev/2006-January/005137.html (found
in PR36).
I expect this link to be broken since our servers are not on that domain.
No big deal, just change it to lists.llvm.org:
http://lists.llvm.org/pipermail/llvmdev/2006-January/005137.html
Looks like that doesn't exist, as the
2012 Apr 23
1
Searching and returning arrays
im a begginer in RoR and am using rails 3.2.3 and ruby 1.8.7
This forum has helped me to progress but I''m confused by one thing.
My app is supposed to allow seaching for results depending on the check
boxes that are checked. In my case, when the user checks a determined
facility and clicks "search" the corresponding hotels with only those
facilities should be returned. I can
2010 Nov 16
6
rails 3.0.3 and visit_CoercibleString errors
From having no errors with 3.0.2 I now see lots of these errors when
running my tests.
undefined method `visit_CoercibleString'' for #<Arel::Visitors::MySQL:
0x000001074f4298>
Anyone know what this is?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2011 Aug 14
5
Puzzled with form on multiple table rows
I''ve got a table of events, and each event has a boolean attribute
is_ten_event.
On each row of the table is a chekbox to edit the value of is_ten_event,
so that multiple rows can be edited with one submit.
In order to allow boxes to be un-checked as well, the logic in the
controller works like this
get array of events from checkboxes that are ticked.
make all events.is_ten_event =
2012 Apr 18
2
RoR - Search Forms with Checkboxes, display appropriate results
I have a form that allows me to search a hotel by city or name and by
rating through radio buttons. It all works.
However, my hotel model has_one :facility, this facility model is
composed by several boolean fields (for example, roomservice:boolean
restaurant:boolean and so on)
The question is, I want to add checkbox fields for each facility I have
and in the search form, when the user selects
2012 Dec 18
1
Arel limit Where if fields are present
I trying to create a select using Arel but I''m passing three parameters, I
want to include the parameters only if they are different to nil or blank.
Here is my method:
def self.advsearch(summary_description, specialties, place)
User.joins(:experience,:summary,:information)
.where(Information.arel_table[:business].eq(false))
2012 Mar 13
2
[Arel]Building query, but can't get a proper output
I have the following code:
advertisements_arel = Advertisement.order("advertisements.id
DESC").arel
@advertisements = (params[:website_id].present? ?
advertisements_arel.where(:website_id => params[:website_id]) :
advertisements_arel).to_a
It returns a struct Arel::SelectManager::Row data
But I''d like it to return an array of Advertisement objects (like it
would
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
2009 May 09
4
Generating a "conditional time" variable
Hi everyone,
Please forgive me if my question is simple and my code terrible, I'm new to
R. I am not looking for a ready-made answer, but I would really appreciate
it if someone could share conceptual hints for programming, or point me
toward an R function/package that could speed up my processing time.
Thanks a lot for your help!
##
My dataframe includes the variables 'year',
2016 Jul 22
2
Old mailing list links broken.
On Fri, Jul 22, 2016 at 2:37 PM, Tanya Lattner <tanyalattner at llvm.org>
wrote:
>
> On Jul 21, 2016, at 11:59 PM, Sean Silva <chisophugis at gmail.com> wrote:
>
> Hi Tanya,
>
> I was spelunking through bugzilla and ran into an old mailing list link
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2006-January/005137.html
> (found in PR36).
>
> I expect this
2011 Jul 25
5
Arel quiz: complex queries with associations
I have a real-world application with some complex queries that I want to
convert to Arel (as part of an upgrade to Rails 3.1). So that I can
understand what I''m doing before I flail around in my real app, I wrote
a little sample app (just the models) with some similar associations --
one table joined with itself and more tables that join to another table,
so there are some queries that
2013 Feb 19
4
Float::INFINITY ranges in where() clause
This seems like such an obvious idea that I''m having trouble believing
I''m the first to think of it. Why not take ranges containing
Float::INFINITY and translate them to the appropriate greater than or
less than comparisons? Example:
class Person
scope :voters, -> { where(born_on: (-Float::INFINITY..18.years.ago)) }
end
This would generate something along the lines of
2014 Nov 10
2
[LLVMdev] External names for LTO in gold plugin
Hi,
In my work applying -flto to Chrome, I need to set some names to be skipped
by the InternalizePass; otherwise, the linking stage fails (i.e., when
building the chrome binary). In the past, I had a tiny patch that I hadn't
submitted to LLVM: it was something like:
Index: Internalize.cpp
===================================================================
--- Internalize.cpp (revision
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
2011 Mar 16
19
Uninitialized constant Files::Magick -still around
Hi there,
I''m solving the problem about the plugin Magick. In my app in Gemfile
I''ve follwoing:
require ''rubygems''
require ''mongo''
require ''RMagick''
include Magick
and in a model Files:
class Files
def self.save(upload)
...
img = Magick::Image.read(''public/data/nature6.jpg'').first
end
end