find-by-sql
Rails and sql: rewriting find_by_sql
I have a Product and Creator table, I also have a table called CreatorProduct which joins the creator with the product. A product can have many creators and a creator can have many products. What I wa[详细]
2023-04-12 11:07 分类:问答Rails, how to sanitize SQL in find_by_sql
Is there a way to sanitize sql in rails method find_by_sq开发者_如何学Pythonl? I\'ve tried this solution:[详细]
2023-03-29 23:34 分类:问答DataMapper and find_by_sql problem
Player.find_by_sql([\"SELECT u.id, u.name, UNIX_TIMESTAMP(u.last_active) AS last_active, TIME_TO_SEC(TIMEDIFF(NOW(), u.last_active)) AS time_difference, r.status, SUM(d.amount) AS gold_spent, SUM(d2.a[详细]
2023-03-26 20:46 分类:问答find_by_sql and pagination with kamanari
I have a model that connects to an ext开发者_开发百科ernal database and I query using the find_by_sql method like so:[详细]
2023-02-23 12:40 分类:问答ActiveRecord Custom Query vs find_by_sql loading
I have a Custom Query that look like this self.account.websites.find(:all,:joins => [:group_websites => {:group => :users}],:conditions=>[\"users.id =?\",self])[详细]
2023-02-13 03:09 分类:问答Is it possible to combine will_paginate with find_by_sql?
In my Rails application I want to use the will_paginate gem to pa开发者_运维百科ginate on my SQL query. Is that possible? I tried doing something like this but it didn\'t work:[详细]
2022-12-25 02:54 分类:问答How to make activerecord use a field generated on the fly by find_by_sql
I\'m using find_by_sql with Activerecord which I generate another field there that doesn\'t in the开发者_开发技巧 original table as a combination of different fields like:[详细]
2022-12-24 18:56 分类:问答Ruby on Rails: Is it possible to :include the other leg of a circular join table?
I\'m working on an application that models friendships between users. class User has_many :friendships has_many :friends,[详细]
2022-12-22 12:15 分类:问答Ruby on Rails: Instantiate associated models with find_by_sql?
Apparently, include and select can\'t be used simultaneously on a Rails find query, and this has been repeatedly marked as wontfix:[详细]
2022-12-22 11:58 分类:问答