What about initialize_dup? El jul 9, 2012 2:11 p.m., "Nicolas Sanguinetti" <[email protected]> escribió:
> dup doesn't take arguments because in ruby dup doesn't take arguments. It > wouldn't make sense to break the semantics of ruby just for this, IMO. > > Cheers, > -foca > > > > On 09/07/2012, at 14:23, Kurt Werle <[email protected]> wrote: > > dup takes no args > create and new both take the same args, and create can take a block > > It seems to me it would be more consistent (and convenient) if I could do > > some_record.dup(attributes_i_want_to_change) do |dup_record| > dup_record.attribute = some_value > self.relationship.dup(reverse_relationship: dup_record) > end > > I'd be happy to throw some code & tests at this (seems like it'd be a > trivial change) if it seems like the right thing to do. > > Thanks, > Kurt > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-core/-/YUQy_CN1B3UJ. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
