On 8 May 2014 16:03, S Ahmed <[email protected]> wrote: > I am inside a model, and need to create another model, how to I pass 'this' > as a parameter? > > > Example: > > > class User < AR > has_one :company > def create_associations! > @company = Company.build_with_user(this)
use self.build_company instead. See http://guides.rubyonrails.org/association_basics.html#has-one-association-reference Colin -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuAVM%2BPETCuY0%3DPBnoqgwsmBJGg122zX3umrRxxjE3Q0A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

