hello everyone,

is it possible to instantiate a model class with it's id instead of
pulling it from the db?

thanks in advance.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Jeremy Walker at May 18, 2012 at 11:46 pm

    On 19 May 2012 00:28, mengu wrote:

    hello everyone,

    is it possible to instantiate a model class with it's id instead of
    pulling it from the db?
    SomeObject obj = SomeObject.new
    obj.id = 10

    Is that what you mean? What's your use-case for this?

    thanks in advance.

    --
    You received this message because you are subscribed to the Google Groups
    "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to
    rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/rubyonrails-talk?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMay 18, '12 at 11:28p
activeMay 18, '12 at 11:46p
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Mengu: 1 post Jeremy Walker: 1 post

People

Translate

site design / logo © 2022 Grokbase