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 .
On Saturday, August 1, 2015 at 12:28:49 AM UTC+5:30, Elizabeth McGurty wrote: > > 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 > interested in helping you. > Liz > > On Friday, July 31, 2015 at 2:30:55 PM UTC-4, nilayy...@gmail.com wrote: >> >> 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, >>> 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 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, Developer and Technical Writer >>>> urub...@gmail.com >>>> Visite meu blog: http://www.urubatan.com.br >>>> >>>> Melhor livro de RoR do Brasil: http://livro.urubatan.com.br >>>> >>>> >>>> On Fri, Jul 31, 2015 at 3: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 . Or can you tell me how to right exact query where I can >>>> get >>>> > the result like case when and then . >>>> > >>>> > -- >>>> > Posted via http://www.ruby-forum.com/. >>>> > >>>> > -- >>>> > You received this message because you are subscribed to the Google >>>> Groups "Ruby on Rails: Talk" group. >>>> > To unsubscribe from this group and stop receiving emails from it, >>>> send an email to rubyonrails-ta...@googlegroups.com. >>>> > To post to this group, send email to rubyonra...@googlegroups.com. >>>> > To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/rubyonrails-talk/82e6f23c602c4de49d4a87d2d27c6393%40ruby-forum.com. >>>> >>>> >>>> > For more options, visit https://groups.google.com/d/optout. >>>> >>> -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ab0abe9a-5f5a-48af-bb2f-ebffaa446e2c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.