similar to: to_yaml problem with option hash

Displaying 20 results from an estimated 9000 matches similar to: "to_yaml problem with option hash"

2012 Jul 05
1
hash to_yaml in erb template not giving valid yaml
Hi, I want to use a file resource to write a facts.yaml file for Mcollective. For some reason it won''t provide a valid yaml format if I dump my scope to hash and convert to_yaml. file { "/etc/mcollective/facts.yaml" : owner => root, group => root, mode => 400, loglevel => debug, #content => inline_template("<%= scope.to_hash.reject {
2008 Jul 26
0
fixtures, how to set a serialized Hash object
I defined in my model : ... serialize :unavailables .. which is set like this (Hash : "year" => 2-dimensional Array) {"2008" => Array.new(13).map!{ Array.new(32, 1)} } In my fixture I need to initiliaze this field with the following hash : {"2008" => Array.new(4).map!{ Array.new(32, 1)} + Array.new(1).map! { [1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2010 Jul 17
1
not able to find to_yaml definition
I am looking at rails edge source code. I am able to do puts User.find.to_yaml However I am not able to find piece of code where ''def to_yaml'' is. How this to_yaml serialization is working? can fully understand how to_json and to_xml is working but to_yaml beats me. Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Mar 23
7
Fixtures just Do Not Work for Me
Hello, I have been struggling to get fixtures to work here with no success. They just Do Not Work For Me (tm). I have created a model named Headline with the `generate'' script and modified the test/fixtumes/headlines.yml as follows ---------- gita: id: 1 author: raulseixas title: gita happened_at: 2005-01-01 00:00:00 description: gita This is the CD reissue of
2006 Jan 11
0
Limit attributes written out by to_yaml
I want to write out a series of records to a text file so that I can quickly edit them and then upload then again into the database. To do this I am using YAML and some code that looks like this: item = Item.find 153 File.open( ''item.yaml'', ''w'' ) do |out| YAML.dump( item, out ) end This dumps out all the field names and values which are stored in the
2005 Dec 31
2
Test Unit Problem
Hello All, I am experiencing the following test unit error working with Rails that I can''t fathom. I have a products.yml file which holds the following test fixture for the products table: dell_pc: id: 1 title: Dell PC description: Dell PC image_url: http://.../pc_image.jpg price: 15000.00 date_available: 2005-12-31 06:53:00 I also have the following product_test.rb file to
2006 Jan 19
4
hash fixture access broken in functional test
I have a functional test class that uses the "topics" fixture. I verified that the fixture is loaded into the database by doing this: assert_equal 2, Topic.find_all.size So I should have an instance variable called @topics and instance variables for each of the rows in the fixture, in this case, @first and @another. But all those variables are nil inside my test method. Is that
2007 Feb 07
0
strange sqlite3 errors - validates_associated & failing activerecord unit tests
I''m getting two strange errors, both which I believe relate to sqlite3. The first one is with validates associated. Here is my test: require File.dirname(__FILE__) + ''/../test_helper'' class SubscriptionPlanTest < Test::Unit::TestCase fixtures :subscription_plans fixtures :publications def setup @six_month_gold = subscription_plans(:six_month_gold)
2010 Mar 23
0
Frozen hash problem
I''d like to delete some records before saving them. I ran this experiment: before_save :prune_lab_datas def prune_lab_datas lab_datas.each do |lab_data| lab_data.destroy end raise lab_datas.to_yaml end But nothing seems to be deleted in the hash: --- - &id001 !ruby/object:LabData attributes: created_at: 2010-03-21 22:16:06 unit_id: "3"
2007 Oct 07
1
How to store a Mechanize object in the database?
Hi, I am trying to save a Mechanize object in database (using a Rails Model). But the save operation throws a TypeError Considering that "agent" is an instance of a Rails Model and "user" is defined as a "text" type in the Model. irb(main):039:0> agent.user = WWW::Mechanize.new #<WWW::Mechanize:0xb71295f0 @follow_meta_refresh=false, @key=nil,
2006 Apr 20
5
Mystified by ActiveRecord.serialize
I''m either missing a step, confused or seeing some odd behavior with ActiveRecord''s serialize feature. When I load an ActiveRecord object from the database, my serialized attribute is a YAML::Object, not the original object. My code is based on an example of this capability in the "Agile Web Dev. w/ Rails" book (p. 196). In create.sql: <code> create table
2011 Mar 29
0
Issue / code smell in AssociationProxy
I came across an issue in my code and after a hard debug session I found something that smells. First the context of my issue. I have a AR object that has a polymorphic belongs_to currently tied to nothing, I want to dump it to YAML. record.to_yaml This raises the following exception: TypeError: wrong argument type nil (expected Data) from
2008 Oct 20
5
RSpec-Rails bug with to_xml?
Hello, everyone. I''ve been lurking here for a while, but this is my first post. I think I''ve run into a RSpec bug in a Rails project I''m working on. I was working on a few REST controllers, and started getting failures on a specific spec that verified whether a certain action returned XML output. I spent quite a lot of time checking my code to see if it was something I
2007 Feb 06
4
Mongrel service will not start on win32 w/ --prefix option
All, I am in need of some help. I''ve run into a problem that I am not able to fix or even troubleshoot. I am trying to run Mongrel as a service on Win32. Basically, my problem is that running Mongrel as a service works fine. Fine until I change the configuration (using service::remove and service::install) to use --prefix. I must have this as I am running multiple webapps and app
2007 Mar 29
1
mongrel and vista
Thanks for your reply Luis > Will be very helpful if you provide the logs (servicefb.log and > mongrel_service.log) both located into ruby\bin directory. --------------------------------------------------------------------------------- # Logfile created on 28/03/2007 17:54:32 native/process.bas:44, fb.process.spawn: Spawn() init native/process.bas:50, fb.process.spawn: Success in
2006 Nov 04
0
Problems with ActiveRecord, Oracle adapter, find_by_sql, multi-table join - ORA-04043 error
Hi all, Windows XP Oracle 10g client OCI8 0.1.16 Ruby 1.8.5 Rails 1.1.6 I''m hitting weird behavior with the Oracle adapter and a find_by_sql call on a multi-table join. The SQL looks like this: SELECT DISTINCT e1.ip_address, loc.street, loc.city, loc.state FROM schema.net_element ne, schema.equipment e1, schema.equipment e2, schema.building b, schema.cust_loc cl, schema.location
2010 Mar 31
3
GArena w/ Linux
Huhu, here I found a tutorial at the GArena forums: > work in ubuntu 9.10? > plz test > > open linux terminal > > 1. type: sudo apt-get install wine (this will download the wine from repository) > 2. insert your computer password > 3. type wget http://www.kegel.com/wine/winetricks (winetricks is a tool for faster linux-windows crossover of files > 4. after installing
2009 Feb 05
0
Extended attributes fail mactomac
Hi All, I have a problem transferring extended attributes from a mac to a mac. A local copy does work. Is this a known issue or am I making a mistake. the command I am running: rsync -aXv --rsync-path=/opt/local/bin/rsync /Users/bas/Library/Fonts bas@play.bushbaby.nl :/Users/bas/Desktop/ several copied Fonts are zero Kb, while when I do it local to local they are their correct size and work
2006 Jun 08
4
datetime fixture format for Mysql 5.0
Hi All: I develop on several machines, most have Mysql 4.* and one has Mysql 5.0. On 4.*, the following erb for a fixture works fine: updated_at: <%= 1.days.ago.to_s:db%> But fails on 5.0. I had a similar deal when I had date fixtures, and switched forrmats so that both 4.* and 5.0 were happy. is there to_s:db_works_for_mysql_50() ? or similar? Thanks Forrest
2010 Dec 17
1
flash[;notice] not display after redirection
I read all previous posts about the same subject in Devise group but couldn''t find any answer, so iy may not be related to Devise , so I debugged it .. . class Users::RegistrationsController < Devise::RegistrationsController .. # POST /resource/sign_up def create build_resource if resource.save if resource.active? set_flash_message :notice, :signed_up