email ID issue

Hi,

I am facing this error in my application previously it was working

Rails 5.0.0.1

Ruby 2.3.0

NoMethodError (undefined method `email’ for #Pin:0x007fbec7e1ad60):

def create

@pin = current_user.pins.build(pin_params)

respond_to do |format|

  if @pin.save  ========> showing error at this line

     redirect_to @pin, notice: 'Pin was successfully created.'

  #  format.json { render :show, status: :created, location: @pin }

  else

    render  :new

  #  format.json { render json: @pin.errors, status: :unprocessable_entity }

  end

end

end

Thnaks in Advance

What did you change between now and "previously"?

I guess only just rails version. It was my older app.

"only just" LOL

Did you upgrade from the last previous major version? If so, did you
fix all the deprecation warnings?

Is this part of your code covered by tests? If not, writing them would
be a good next step...