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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:42:09+00:00 2026-06-12T07:42:09+00:00

I am creating an application for live event merchandise sales. I have a table

  • 0

I am creating an application for live event merchandise sales. I have a table of inventory_events, each inventory_event represents a change in inventory over time. Because of the nature of my application I need to track 1 master inventory (all of the items in stock) and an inventory per event.

Essentially this is what my flow looks like:

  • Assuming that today is an event day
  • New inventory_events are created for each inventory_item being sold at the event
  • these inventory_events are called ‘check ins’, they are checking the items into the event
  • this creates a negative inventory_event and these items are subsequently removed from master inventory
  • after an event is complete the remaining stock is ‘checked out’ of the event
  • this creates a positive inventory_event and the left over items are added to inventory
  • the net qty_change on these 2 transactions becomes my net items sold at this event

Currently this is how I have it set up:

  • each Event has_many :inventory_events
  • when creating inventory_events I am updating this via a fields_for in an Event update form
  • this works fine for checking items in

My problems begin at checking items out (out of the event but into the system)

  • Set up is the same as above except I need to be able to build 1 inventory_event for each check out event associated with this particular day’s event

My question is: How can I build 1 new field_for inventory event per inventory_event previously associated with this day’s event? I know I can just count the number of events & then build 1 for each but how do I do that & also maintain some information (item_id) so I am able to know that I am building a check in event for each item i had checked out on this day?

Thanks a lot.

  • 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-12T07:42:10+00:00Added an answer on June 12, 2026 at 7:42 am

    You could start building a form using the previously known data. Let’s say you have

    class Event
      has_many :check_ins # STI subclass of InnventoryEvent
      has_many :check_outs # same
    end
    

    Then you could prepopulate a list of checkouts, where each correspond to one of the already registered check_ins for the same event. In the end you won’t check out things that were not checked in before…

    class EventCheckOutController
    
      def new
    
        @event = Event.find(params[:event_id])
        @event.check_ins.each do |ci|
          @event.check_outs.build(:item_id => ci.item_id, :amount => ci.amount)
        end
    
        # render....
      end
    end
    

    So the object will have all the checkouts, also preset with the same amount as initially checked out, you can change it afterwards form the form.

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

Sidebar

Related Questions

I am creating application where in i have used preferences for changing font settings.
i creating an application with movie animation , i have a animation some group
I am creating an application in which I am using Live Id authentication. When
I have an MFC application (using a legacy library that I can't change). When
I have read about creating folder in SkyDrive with Live SDK here (the don't
Possible Duplicate: Change language programatically in Android I am creating Application which is a
I have done like this for creating click event handler for one part of
I have simple console application project for live video streaming using cross-platform libs on
I am creating an application which streams a live feed of the blackberry screen
How to create a Live CHat application in JSP. Basically i am creating a

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.