arel
Rails 3, RSpec 2.5: Using should_receive or stub_chain with named scopes
I use Rails 3.0.4 and RSpec 2.5. In my controllers I use named scopes heavily, for example @collection = GuestbookEntry.nonreplies.bydate.inclusive.paginate([详细]
2023-02-16 07:59 分类:问答Count of a relation using arel in active record
I\'m having a really rough time figuring out how to do this query and others like it in arel from active record.[详细]
2023-02-14 18:16 分类:问答Rails 3: Order a query that uses a has_many and belongs_to association in one query
In my Rails db 开发者_如何学JAVAscheme there is the following structure: tasks has many jobs jobs belongs to one category[详细]
2023-02-14 14:18 分类:问答"IS NOT TRUE" with Rails 3 query or meta_where
开发者_JAVA技巧What I need is probably very simple: Table.where(\'field is not true\') but I can\'t figure how this is done with Rails 3 query interface, and probably with meta_where.The problem is[详细]
2023-02-14 06:05 分类:问答Generating a subquery with Arel to get an average of averages
Lets say I have a few of tables orders = Arel::Table.new :orders stores = Arel::Table.new :stores managers = Arel::Table.new :managers[详细]
2023-02-14 02:39 分类:问答Rails 3: Select all submodels where submodel has a certain condition
My Rails db scheme has projects and task. I want to show projects which have at least one open task. This is my code:[详细]
2023-02-13 23:09 分类:问答How to find records that have duplicate data using Active Record
What is the best way to find 开发者_JAVA百科records with duplicate values in a column using ruby and the new Activerecord?Translating @TuteC into ActiveRecord:[详细]
2023-02-13 00:17 分类:问答Not case sensitive search with active record
I use rails 3.0.4 here is a piece of Arel query in my rails applicati开发者_开发百科on, How can I use the upcase method to make a none case sensitive search in a database agnostic way?[详细]
2023-02-12 06:02 分类:问答Arel, Joins and Rails Queries
I\'ve been stuck on a problem recently for a little while and found my way to Arel which looks like it should allow me to do OR\'s in my queries.[详细]
2023-02-12 05:43 分类:问答Why use SQL builders? Arel v. Sequel v. T-SQL
I\'m trying to understand the benefits of building SQL via an object-oriented builder DSL vs. parameterizing a raw SQL string.After researching/implementing the same query three ways, I notice that th[详细]
2023-02-09 15:56 分类:问答