All Questions
Tagged with postgresql active-record
4 questions
3
votes
1
answer
374
views
Getting timeslots using a single query
I want to get latest time slots for 2 cases based on doorman true for false based on logged in user.
Cases are:
If doorman is true, the query will be the same
if doorman is false, then I need to add ...
2
votes
0
answers
85
views
Fetching photos and tweets related to selected publications
1) Postgresql
2) User has_many :reports
3) Report belongs_to :user
3) Report belongs_to :publication
4) Publication has_many :reports
4) Publication scope :photos, -> ...
2
votes
1
answer
128
views
Building query for search engine
I'm writing a basic search engine for my website.
It works but I'm really unhappy with the code. I know it can't be improved but I'm lacking some experiences here.
In my params from my search I get:
...
5
votes
2
answers
1k
views
How to properly call an "upsert" using parameterized raw SQL to Postgresql in ActiveRecord?
I need to call an upsert to my Category table in PostgreSQL. My current solution uses the exec_query API in ActiveRecord, using ...