You need to create the ActiveRecord associations that you require:
class User < ActiveRecord::Base
has_many :achievements
end
class Achievement < ActiveRecord::Base
belongs_to :user
end
This will give you the opportunity to call a method achievementsfor any objects Userthat you have.
Error
You have an error:
undefined method `achievements' for #<User:0x00000105140dd8>
, undefined User. , , .
, , Rails, Ruby, . , , Rails, , Models:

, , , , "", , .
, User achievements. , , Rails, :
class User < ActiveRecord::Base
has_many :achievements
def achievements
end
end