[I thought that I'd avoid the distraction of critiquing my app in general by only posting code relevant to my question, but whatever--there's good advice here from Jason]
On Mon, 20 Oct 2014 13:58:29 -0400 Jason Fleetwood-Boldt <t...@datatravels.com> wrote: > > I want all the tables, including the membership join table, to have a > > "creator" field that gets populated every time the record is created > > updated. > > > Is created or updated? That sounds like updated_by_user_id (or Oops... that was supposed to be "created/updated" > last_updated_by). There are gems for that, and you should use them. I Any suggestions of specific gems? (Question for anyone, not specifically Jason) My current authentication system doesn't provide this, and I'd prefer a solution that doesn't require me to change my authentication system. Maybe "updated_by_user_id" is the magic google-fu. > > c = Club.find(name: => 'The Rubyists') > > c.members << People.find(name: ['Joe','Ann']) > > > > Generally you always find things by IDs (unless you're searching for > something based on a user query). Not sure why you would want to do a > find by a name. This was not a direct copy from my app. This was just a simple example of what I'm trying to do, (I'd hoped) with an emphasis on my use of the "<<" operator. And actually, it'd probably need to s/find/where/g In particular, there's no obvious method for passing a "creator" field when you're using the "<<" operator like that. -- 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/20141020145952.8a130f4b573666f7a44374a8%40brisammon.fastmail.fm. For more options, visit https://groups.google.com/d/optout.