Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8690099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:49:50+00:00 2026-06-12T23:49:50+00:00

Good day, currently i’m struggling with this error. Failure/Error: FactoryGirl.create(:subscription) NoMethodError: undefined method `attribute_list’

  • 0

Good day, currently i’m struggling with this error.

Failure/Error: FactoryGirl.create(:subscription)
NoMethodError:
undefined method `attribute_list’ for “AdvtCategories”:String

i can’t find correct solution for this error. what i found was a suggestion that some column is the same name as the class. didn’t help
my test

 describe Subscription do
  context "validations" do
    #it { should validate_presence_of :category_id }
    it do
      FactoryGirl.create(:category)
      FactoryGirl.create(:subscription)
      should validate_uniqueness_of( :category_id).scoped_to(:user_id) 
    end
   # TODO validator :category_should_exist
  end  
  #it { should belong_to(:user) }
  #it { should belong_to(:category) }
  #specify { Subscription.per_page.should eq(20) }
end

factories:

factory :subscription do
    association :category, factory: :category, :class => 'AdvtCategory'
    user
  end

factory :category do
    name "MyString"
    alias_name "MyString"
    number_of_items 1
    type ""
  end

UPDATE 1
it’s a factory_girl error. solving it

UPDATE 2

it’s factory_girl error on create (build passes of course, so db error)
updated code

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:49:51+00:00Added an answer on June 12, 2026 at 11:49 pm

    Changed from one class to another.

    require 'spec_helper'
    describe Subscription do
      before do
        FactoryGirl.create(:subscription)
      end
    
      context "validations" do
        it { should validate_presence_of :category_id }
        it do
    
          should validate_uniqueness_of( :category_id).scoped_to(:user_id).with_message(/уже создана/) 
        end
      end  
      it { should belong_to(:user) }
      it { should belong_to(:category) }
      specify { Subscription.per_page.should eq(20) }
    end
    
    
      factory :subscription do
        association :category, factory: :advt_category 
        user
      end
      factory :advt_category do
        name 'Category'
        alias_name '1'
      end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day! I am currently trying to create a background-image with multiple images on
Good day pals! Currently I'm studying this database model design called Modified Pre-order Tree
Good Day, Can someone confirm what was said at the bottom of this post
Good day, all. I know that this is a pretty basic question in terms
Good day. Currently I'am looking for 3D engine for iOS written on C++ as
Good day! Currently i'm thinking about implementing caching on a website. I've read an
Good Day to all. I am currently developing a chat application using cakePHP. It
Good day everyone! So currently I'm working on a project with video processing, so
Good Day, I'm currently designing database structure for a website of mine. I need
Good day, I'm not sure if this is possible but I want to merge

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.