On Jul 31, 2015, at 12:09 PM, Nilay Singh li...@ruby-forum.com wrote:
Fixing a schema is other thing this very straight forward question how
can I generate the query which I am using in find_by_sql or is there any
mechanism where I can select two tables without join and use the case
and when
the query is possible
you need to show us your schema for a better answer (or at least the
parts of the schema that are involved in the question)
and I'm having problems understanding what you write, there are no
commas, no points, no new lines, ...
Rodrigo Urubatan Ferreira Jardim
Architect,
I am attaching the schema a full schema of my code there are three
tables involved first one is messages and other one users and next one
is message_replies these three table he I am trying to get the result of
all messages using case and when query . I am attaching a link for
schema :
I am adding the user model and message model have a look and if it is not
enough let me know .
https://gist.github.com/nwoow/62f45077f340eb8ffe0b
On Friday, July 31, 2015 at 11:53:50 PM UTC+5:30, Elizabeth McGurty wrote:
I would add that we also need to see the Message and User Models, eg,
Fixing a schema is other thing this very straight forward question how
can I generate the query which I am using in find_by_sql or is there any
mechanism where I can select two tables without join and use the case
and when . Or can you tell me how to right exact query where I can get
the result
I am adding the user model and message model have a look and if it is not
enough let me know .
https://gist.github.com/nwoow/62f45077f340eb8ffe0b
On Friday, July 31, 2015 at 11:53:50 PM UTC+5:30, Elizabeth McGurty wrote:
I would add that we also need to see the Message and User Models, eg,
I would add that we also need to see the Message and User Models, eg,
managing primary key outside of Rails convention.
Liz
On Friday, July 31, 2015 at 2:14:42 PM UTC-4, Urubatan wrote:
the query is possible
you need to show us your schema for a better answer (or at least the
parts of the
I am attaching the schema a full schema of my code there are three
tables involved first one is messages and other one users and next one
is message_replies these three table he I am trying to get the result of
all messages using case and when query . I am attaching a link for
schema :
What strikes me immediately is the question, does your User table contain
the foreign key user_one? Otherwise, can I offer some advise? Try to
calm down. The process in Rails development isn't always easy, sometimes
it is down-right difficult. In my experience here, folks are genuinely
No user table does not contail foreign key user_one infact message table
contain user_one when I am using this has_many :messages,class_name:
Message,
foreign_key: user_one I in user model I
ma getting the error what should I do to get the exact result help me
10 matches
Mail list logo