Displaying 20 results from an estimated 600 matches similar to: "How to store a Mechanize object in the database?"
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
2006 Jun 20
2
Problem with "can''t dump anonymous class Class"
I submitted this earlier, but the web forums went down and I''ve screwed up
the thread, so I''m starting over.
I''m trying to built a document upload system. The system has a main
Document model with different subclasses for different types of documents.
With the code below, if I attempt to create a Document, it works fine, but
if I attempt to use one of the subclasses, I
2007 Sep 14
1
Unable to scrap gmail.com - EOFError: End of file reached
Hi all,
I am so excited to use mechanize! It has opened a whole new world of
projects for me :)
I am trying to login into the Gmail.com server, as described in
http://schf.uc.org/articles/2007/02/14/scraping-gmail-with-mechanize-and-hpricot
but am running into a few issues...
irb(main):010:0> page = agent.submit form
EOFError: end of file reached
from
2007 Feb 13
10
Is there a limit on the size of a template?
Hello,
I have recently run across the following error:
/usr/lib/ruby/1.8/yaml/rubytypes.rb:315: [BUG] Segmentation fault
This has happened after adding a particularly large template file with ruby 1.8.1.
Thank you,
-- Rob --
____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews
2007 Dec 30
3
A newbie question regarding BackgroundRb
Hi all,
I just read Ezra''s article on BackgroundRb and decided to use it one
of my projects. I installed the plugin into my rails project using
script/plugin and then ran rake backgroundrb:setup to copy the yml
scripts.
Now my backgroundrb.yml looks like
=======
---
port: "22222"
timer_sleep: 60
load_rails: true
environment: development
host: localhost
database_yml:
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 {
2007 Sep 24
1
selecting a form
What''s the best way to select a form on a page with Mechanize if the
form doesn''t have the "name" attribute? I''m already familiar with the
page.form(''myformname'') syntax but this doesn''t? work with forms that
have no names.
--
Thank you,
Shane Witbeck
Digital Sanctum, inc.
-----------------------------------------------------
2007 Nov 06
6
size of template file
Hi,
How big a template file can be?
When I tested with a kind of large file (about 23KB, 570 lines),
puppetmasterd ended up with a segmentation fault.
Then I made the file shorter than original (about 6KB, 145 lines),
the file was created but it is shorter than it should be.
What I have is just 3994 bytes and 80 lines.
Replacing the string is done correctly.
I would like to know the limit of
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 Jun 23
0
to_yaml problem with option hash
Hi,
I''m trying to make a fixture for testing with a serialized column. In
the YAML fixture I''m trying to fill the serialized column with the
to_yaml function. But I keep getting the ''---'' separator, which I don''t
want because it is only a ''partial'' yaml fill.
According to the documentation to_yaml takes a hash of options, so
2006 Jun 19
3
can''t dump anonymous class Class
I''m trying to create a document upload system, where most of the code is
the super class Document and just the path to file on the system is
controlled by the sub classes. When I attempt to use my code, I get the
following when I try to save the document.
can''t dump anonymous class Class
Any ideas?
** Migration **
class CreateDocuments < ActiveRecord::Migration
def
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
2009 Apr 09
1
method_exists? is missing?
In a controller run through webrick I do this:
@entity = Entity.new
print @entity.methods.sort.to_yaml
and I see this:
- logger
- mark_for_destruction
- marked_for_destruction?
- metaclass
- method
- method_missing
- methods
- new_record?
There is no method_exists? method. If I instead do this in a console
session, I see this:
$ script/console
>>
>> @entity = Entity.new
=>
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
2007 Aug 30
4
Templates and Ruby
Hi,
I am using a template to create an /etc/exports file. I have a template
that looks like this (but results in the puppetmasterd dying on the
server when the client updates):
<% nfsHomeClients.split.each do |host| -%>
/nfs <%= host %>(<%= mainshareoptions %>)
<% nfspaths.each do |path| -%>
<%= path %> <%= host %>(<%= nfsoptions %>)
<% end
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)
2008 Mar 10
2
response.body == filename?
I''m using RSpec.
describe UserController do
it "should require ..." do
post :login, {:name => ''root''}
puts response.body.to_yaml
end
end
....--- user/login
?????
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this
2007 Jul 23
2
Firebird, fireruby
Hi Guys
I am pretty new to Ruby. One of our client is using Firebird as his
backend database. I have to create a script which will connect to his
database, fetch some data and update few tables in MS-SQL database.
Now problem is: i have installed FireRuby, got databaes, changed my
database.yml file.
I am trying to display all the users in Members table. but i am
getting following error:
2007 Mar 18
2
mongrel timing out
I am not sure when it exactly occurred but I have 2 servers I am about to
migrate to apache+mongrel from lighty+fastcgi
oddly, both my servers seemed to have died at the same time everytime I
restart within a 24 hr period ( I don''t know when, my logs don''t show it ).
Can someone please point me in the direction of what I need to do to trace
the cause of this. Or what you would
2008 Nov 12
5
dynamic condition for has_one and eager loading issue
Hi,
I ve defined the following relation in one of my models with a dynamic
where condition:
has_one :selection,
:foreign_key => ''object_id'',
:conditions => ''selection_type = 1 and account_id = #
{self.send(:account_id)}''
That works perfect, however when I try to eager load that relation I
am getting the following error when doing a