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 4023564
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:36:50+00:00 2026-05-20T10:36:50+00:00

Using Machinist, is there some way one can define blueprints such that they inherit

  • 0

Using Machinist, is there some way one can define blueprints such that they inherit attributes from other blueprints? I’ve looked at all the documentation and examples I’ve found, but I haven’t seen it happening.

I want to do something like this:

User.blueprint do
    name
    email
end

User.blueprint(:admin) do
    is_admin { true }
end

User.blueprint(:editor) do
    is_editor { true }
    group
end

User.blueprint(:contributor) do
    is_editor { true }
end

Where they all inherit the name/email from the first blueprint, and the :contibutor blueprint inherits the group attribute from the :editor blueprint.

Is this possible?

  • 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-05-20T10:36:50+00:00Added an answer on May 20, 2026 at 10:36 am

    Yes, that’s partially possible, at least with Machinist 1 (I haven’t tried with Machinist 2). You can only inherit attributes from the default blueprint of a given class.

    Your syntax is correct, see “Named Blueprints” in https://github.com/notahat/machinist/tree/1.0-maintenance but your blueprint contributor directly inherits from the default User blueprint. You would have to set manually the group attribute in you contributor blueprint.

    The syntax to create an admin user is User.make(:admin).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On Linux, for a C/C++ program using pthreads, is there a way to see
I've created some windows in wpf that I need to print to one xps
I have developed an application that have a slider that showing some data from
I'm trying to pull some data out of logs on remote machines using awk,
I have a need to be able to identify one system from another in
I'm currently using subversion and tourtiseSVN. I am looking to revamp the way my
I'm finally set up to be able to work from home via VPN (using
I am using a cluster of computers to do some parallel computation. My home
I am currently using git for a project that has two participants (me and
In short: How can I use Hg to synchronize repositories between two computers using

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.