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

  • Home
  • SEARCH
  • 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 9244783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:07:06+00:00 2026-06-18T09:07:06+00:00

I have a field in an Order table that gets populated by other values

  • 0

I have a field in an Order table that gets populated by other values which works fine as per example below:

company_name: A-Z Traders
company_tel: (111) 111 1111
MD5_hash_field: A-Z Traders|(011) 111 1111

This is working on the creation of the record through hidden field.

What I require is that MD5_hash_field then gets MD5 hashed before it is saved into the database.

Tried adding the following:

before_create :hash_field

def hash_field
  self.md5_field = Digest::MD5.hexdigest(self.md5_field)
end

But does not seem to do anything

Edit:

It does Work to a Degree

<%= f.hidden_field :checksum, :value => '10011013800|Customer1|3299|ZAR|http://localhost|2012-01-30 18:30:00|secret' %> 

   Result should be: 31d1244f08a62f0551e9263c4835ba88

   but getting : aae1ee590e4d4e08e7c0363cca90a22b

Solved:

This Does Work! - Fellow Developers when working on multiple Applications make sure you are restarting the correct App. LOL
  • 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-18T09:07:07+00:00Added an answer on June 18, 2026 at 9:07 am

    Couldn’t you change the code to

    def hash_field
      p self.md5_field
      self.md5_field = Digest::MD5.hexdigest(self.md5_field)
    end
    

    And see what it gives you in the logs?

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

Sidebar

Related Questions

Let's say I have an Order table which has a FirstSalesPersonId field and a
I have a table that has a value field. The records have values somewhat
I have a very simple webforms app that will allow field techs to order
Usually I would have a table field called ID on auto increment. That way
I have some sprocs that need a temp table. In order not to hardcode
I have an int field in my product table called product_stat which is incremented
I have a field in my database table that use to store an enumeration
In Lightswitch I have an order table that has a one to many relationship
I have this javascript, jquery function, (below) It gets the text inside each table
I have a function that gets a SQL code and inserts a count field

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.