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

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -