similar to: generate 10 UUID records and save it it database in rails

Displaying 20 results from an estimated 300 matches similar to: "generate 10 UUID records and save it it database in rails"

2013 Oct 25
6
Migrate postgresql database to uuid
Hi all, I am using rails 3.1 and ruby 1.9.3,Now i want to use uuid concept in rails 3 for existing data so i did like :- create_table :posts, :id => false do |t| t.string :uuid, :limit => 36, :primary => true end ActiveRecord::Base.class_eval do # old rails versions set_primary_key ''uuid'' before_create :generate_uuid def generate_uuid self.id =
2006 Apr 04
3
uuidtools across processes
Hello, It seems that there is a small probability of collisions among uuid''s produced by uuidtools'' UUID.random_create() running in concurrent user processes on a host (fcgi)? The ~2 bytes extracted from the randomized clock_sequence make a collision unlikely. http://rubyforge.org/frs/download.php/8572/uuidtools-1.0.0.zip Do I miss something? DD -- Posted via
2006 Feb 22
4
UUIDTool and weird timestamp split error
Hi, I am using UUIDTools to generate my Guids. It works fine on my computer (Windows Xp), but doesn''t work on my host (TextDrive) The error is: Loading production environment. >> UUID.timestamp_create.to_s /sbin/ifconfig: Permission denied NoMethodError: private method `split'' called for nil:NilClass from ./script/../config/../config/../lib/uuidtools.rb:236:in
2008 Apr 03
1
Problem with UUID generated in partial not being unique
Folks, I''m using the "uuidtools" package to generate (hopefully) unique values for IDs within a partial (for products being added to an order form, where nothing is saved to the DB until the end). Unfortunately when I add a new product line (using RJS page.insert.html rendering a partial) the new lines added all have the same UUID. Here''s the code from the (top of
2007 Aug 23
1
Hints & examples for content creators & packagers
At speex.org, I read that Speex is well-suited to internet audio streaming and audio books. However, I am having difficulty finding or creating audio-book-type material of acceptable audio quality vs file size. For the sake of comparison, look at the speex sample in Ubuntu's example-content_26_all.deb vs http://podcast.msnbc.com/audio/podcast/pd_mtp.mp3 The mp3 sounds ok, streams and seeks
2008 Mar 02
0
Models are not initialised correctly with ''rake test'' in Merb 0.9.1
I''m using Sequel as my ORM and Test::Unit as my testing framework and have the following model: class Item < Sequel::Model validates do presence_of( :name, :uuid, :vendor_id, :vendor_reference, :amount, :currency_code ) uniqueness_of( :uuid ) end def initialize( *args ) super( *args ) self.uuid = UUID.random_create.to_s end end As you can see I overwrite
2008 Jul 05
5
Does RSpec work nicely with UUID primary keys?
I have my application happily generating UUID primary keys using the uuidtools gem. But the auto-generated specifications created by "script/generate rspec_scaffold...", etc, assume that one is using a sequential integer primary key. For those who have hit this same issue, is it just a matter of rewriting the auto-generated specifications to take this into account, or does one have to
2006 Jan 30
4
How to encode URLs?
How does one encode URLs in ROR? Thanks Frank --------------------------------- Bring words and photos together (easily) with PhotoMail - it''s free and works with Yahoo! Mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060130/60280869/attachment.html
2005 Dec 14
3
Advanced routing question.
Hello All, I''m making a quick application that tracks outgoing links to referral sites. I need to track the user and the url they went to so the easiest way would be to take the entire url as a parameter and log that into the database. I was wondering if I could do something like this with routing: http://www.example.com/user/jump/http://www.myvendor.com/referral.php?
2008 Dec 13
2
Need Help in converting php encryption decryption code to ruby on rails
Hi guys i found this encryption decryption in php and try to convert it in rails but i am unable to successfully convert it. So plz help me. I you write the whole conversion code then it will be great. PHP code is like this ================ # #/********************************************** #** #** MD5 block cypher #** #** Author..: leapinglangoor [
2007 Dec 03
1
depcryption and base64
Just wondering is anyone can explain this code to me: Base64.encode64(@key.send("#{key_type}_encrypt", text)) I have this code the encrypts some information. This part seems to work fine. I using some software on the back end that I have written in VB to decrypt it and it seems to have issues. So I just wanted to make sure that the code i have written in Ruby does what I think it does,
2012 Oct 15
2
base64 within module
I have to convert a string in base64 before placing it inside a template with puppet. Is there a function available and how? Thanks Luca -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/ZgLjlG_IeI4J. To post to this group, send email to
2009 Sep 30
3
How to search and replace all urls on a HTML string using RUBY gsub
Hi , I trying to search and replace all urls on a HTML string using gsub . CODE html = "<a href=''http://site.com.br''><img src=''http://site3.com/ image.jpg''></a><a href=''http://newx.com.br''><img src=''http://localhost/ imagem.jpg''></a>"; pattern = /<a
2008 Apr 10
2
Testing an action behind HTTP Authentication
Greetings, I''m writing an integration test and would like to make sure that, with the correct credentials, I get the proper response. The problem is I don''t know how to use the ''get'' method to attach the username and password to the request. For example, when using RSpec''s Story tests.. When("I request the user information for that
2012 Jul 31
1
puppet doc questions
Does puppet doc require a specific version of any gems (such as rdoc or rake) to operate? I''m getting some errors when I try to generate my rdoc now. # puppet doc --output /var/www/test --modulepath /etc/puppet/environments/test/modules -m rdoc RDoc::RDocError is deprecated and will be removed in RDoc 4 Could not generate documentation: uninitialized constant RDoc::RDoc::Generator
2009 Apr 24
4
Long string in crypting
I use a solution to crypt a string that I found using OpenSSL. But the crypted string becomes very long, too long for a varchar 255 to hold it. What can I do to make it shorter? Or should I just use text as column in the mysql db? public_key_file = ''lib/public.pem'' public_key = OpenSSL::PKey::RSA.new(File.read(public_key_file)) @encrypted_string =
2009 Jul 20
9
rake error
When I run rake test:units I get this error: 292 tests, 350 assertions, 2 failures, 13 errors rake aborted! Command failed with status (1): [/usr/local/bin/ruby -I"lib:test" "/ usr/loc...] This error just showed up yesterday --- I have no idea how I caused it. Here is my gem list in case that helps: actionmailer (2.3.2, 2.2.2) actionpack (2.3.2, 2.2.2) activerecord (2.3.2, 2.2.2)
2011 Jan 28
5
mysql quotation wonky
Why would, in an upgrade from 3.0.1 to 3.0.3, a rake db:migrate run this: SELECT "schema_migrations"."version" FROM "schema_migrations" vs this ? SELECT `schema_migrations`.`version` FROM `schema_migrations` __ rake db:migrate output __ rake aborted! Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
2005 Nov 02
1
Windows, Segmentation Faults, config.load_paths and config.cache_classes
I am doing some testing with the rails trunk, version I switched to because of memory leaks in 0.13.1 under linux environment. Right now the application is running fast and steady under linux, with no memory leaks using SCGI Rails Runner 0.4.3 from Zed, BUT it has become unusable under Windows (our main development environment) where I am getting a lot of segmentation faults. BUT the problem
2006 Jan 12
8
Synching between Sqlite and MySql
Hi folks, I am running an offline Rails app that periodically connects to the Internet to download the latest catalogue, and upload any new orders. I am about to implement the synching bit - and was thinking whether there is any other solution other than writing webservices and code to do a manual sync of the data, or whether there is a more nifty and robust way using say replication?