ruby on rails - Print variables coming to model's methods -


having following code:

 class mymodel < activerecord::base       before_create :do_process       def do_process          #i want print here came method           self.my_stuff = my_stuff      end 

say have model name , description attributes , i'm going console , enter like

mymodel.create! name: 'test', description: 'test'

so how can view arguments passed method do_process?

it seems want see attributes of object enters do_process method. that, can use attributes method:

def do_process   $stderr.puts attributes   self.my_stuff = my_stuff end 

Comments

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -