similar to: setting attribute in constructor, .NEW works but not .CREATE

Displaying 20 results from an estimated 1000 matches similar to: "setting attribute in constructor, .NEW works but not .CREATE"

2006 May 23
7
back-porting 1.1.1 app to 1.0 rails server
I''ve been developing new application on local machine in rails 1.1.1. Hosting provider (godaddy) is at rails 1.0.0 and not upgrading any time soon I''m told. I set "RAILS_GEM_VERSION = ''1.0.0''" in my environment.rb file to get past inital errors, but now I''m getting the following error:
2008 Jun 03
15
Problem with rails environment with cygwin...mysql doesn't
I have rails 1.2.2, ruby 1.8, mysql 5 and Rad Rails in my win XP and this stack works fine. But I''m trying to use rails 2.1, mongrel, capistrano, git, mysql all in cygwin and e Text Editor.The only think that doesn''t work is mysql.I installed this app from the source(in version 5.0.45, ./configure then make install).All right, but when I try to launch this error occurs:
2006 Aug 12
5
In place editing on a list - not passing ID through
I want to do in-place edits on a list of data, but I''m having trouble getting the ID passed through to the controller. I use this in my view to create the field: <% for frame in @frames %> ... <%= in_place_editor_field :frame, :price %> <% end %> and this produces the following in my output: <span class="in_place_editor_field"
2006 Nov 05
4
sending email..
i am trying to send email via my app, and although it was working previously (i had to fiddle with the authentication to get it to work correctly) but it was working fine.. today, i tested it, and i am getting this: Net::SMTPFatalError (550-Verification failed for <xxx-ip11aQz5vkFBDgjK7y7TUQ@public.gmane.org> 550-(result of an earlier callout reused). 550 Sender verify failed ):
2010 Mar 16
1
Changing global variables from functions
Hey all, I'm relatively new to the R-environment. I'm having a bit of trouble with encapsulation. I have a globally declared variable that doesn't update it when I change it in a function. For example when I run the following function >deckn<-NULL >deck1<-1 #52 card deck >deck<-function() { #Creating a standard deck deck1<-c(1:52) deckn<-deck1 #Creating n
2006 Aug 18
3
Understanding MVC - view customization after using scaffolds
All, I have ordered AWDWR and am anxiously awaiting its arrival. In the meantime I still am playing with ROR using radrails. I have a few questions ... I create a table named customers with the following details: Field Type Null Key Default Extra id int(11) NO PRI auto_increment customer_name varchar(50) NO inbound_retention int(11) NO outbound_retention int(11) NO unix_admin_email
2008 Jun 05
23
unit test question
In development and production, I''ve got postgresql constraints that prevent deleting a CaseManager if there is a Client that belongs to that CaseManager. In unit tests...and obviously in my testing db, those restrictions don''t get added. Is it wrong to test for deleting dependent records in unit tests? Craig --~--~---------~--~----~------------~-------~--~----~ You received
2006 Jun 22
1
Active Record question, orphaned children
I have a Deck object and a Card object with their corresponding tables. (You know a deck of cards.) When I destory a Deck it leaves orphaned cards in the database. Is there a way to set up the objects with ActiveRecord so that when a parent object is destoryed the child objects are destroyed as well? My code below. class Deck < ActiveRecord::Base has_many :cards end class Card <
2006 Jun 21
14
[Bounty] 1 pizza for 1 simple plugin
So here''s the deal. I don''t know the innards of rails well enough to do this quickly but you might. First person to write this and release it under MIT license or public domain, and tells me, gets a free pizza from your favorite local delivery place. You pick the toppings, I''ll call ''em and order it up for you. Yeah a pizza isn''t much but I''m
2006 Mar 19
2
Multiple polymorphic belongs_to declarations
I have the following models: class Card < ActiveRecord::Base belongs_to :deck belongs_to :front, :polymorphic => true belongs_to :back, :polymorphic => true end class TextContent < ActiveRecord::Base has_one :card, :as => :front has_one :card, :as => :back end The conflicting has_one declarations don''t work. What I need is
2006 Nov 06
4
Confirmation fields on forms
I am unsure how to use a confirmation only field in my forms. The perfect example is when registering a user, you want them to type their password twice but you only want to have one record for it. The form fields; user[password] user[password_confirmation] form posted; user = User.new @params[:user] Error is thrown because there is no method for password_confirmation. -- Posted via
2006 Sep 20
3
Can this 1337 PostgreSQL Subquery Union be done in AR?
Just wondering if it''s possible, without resorting to find_by_sql. select id, title, datetime, type from ( select id, title, added as datetime, ''items'' as type from items union select id, headline as title, datetime, ''news'' as type from news ) as items order by datetime desc limit 50; I''m also curious if it''s possible in MySQL. Joe
2012 Jun 15
2
Looking for Speed in a Toy Simulation Example
Dear List Members I used to play around with R to answer the following question by simulation (I am aware there is an easy explicit solution, but this is intended to serve as instructional example). Suppose you have a poker game with 6 players and a deck of 52 cards. Compute the empirical frequencies of having a single-suit hand. The way I want the result structured is a boolean nosimulation
2011 Nov 16
5
Multi-channel labels in Vorbis comments
Hi devs :-) At the Mozilla Festival in London recently, I took part in a Hack the DJ workshop, looking at ways to take digital DJ'ing to the next level: http://www.bbc.co.uk/blogs/researchanddevelopment/2011/11/setting-a-dj-challenge-at-the.shtml One of the ideas proposed was stem mixing, using multichannel files in DJ applications. A proprietary implementation of this idea is Fireplayer
2006 Apr 30
3
require "ajax_scaffold" in model error
Hi there, I''ve got installed ajax_scaffold_generator (3.1.2, 2.2.1) Anyway I''m following the example here <http://height1percent.com/ articles/2006/04/18/ajaxscaffold-3-1-0-released> which suggests the following in a model file: -------------------------------------------------------- require ''ajax_scaffold'' class Pet < ActiveRecord::Base
2006 Oct 23
3
passing parameter to action
i have a table of data in my application. i would like to be able to sort the data in the table by clicking on the column header. the way i was thinking i want to do this is just by making a ''sort'' action, and then calling the sort action from each link in the table header (passing the respective column name). it doesn''t seem to be possible to pass parameters to an
2002 Jan 24
3
getting rank order
I'm doing a study where people place a deck of cards in a certain order. It's sufficient to assume that their colors & each has a number (it's actually about attributes of hobbies). I'd like to look for patterns in how they've arranged the deck. For each subject I have a list like 3,5,2,4,1, indicating that (s)he chose 3 first, then 5, then 2. . . . I think what I first
2006 Oct 11
3
Basic Relationship Problem
I''m trying to do a basic relationship and it''s not working the way it should. The data model is obviously a test database as the fields are minimal. In irb I do the following: >> user = User.create(:name => "shawn") => #<User:0x259ceac @errors=#<ActiveRecord::Errors:0x259c3a8 @errors={}, @base=#<User:0x259ceac ...>>,
2006 Oct 13
3
How to get a count of line_items
I am fairly new to Rails, and I am having difficulty in forgetting the old way of developing and using the Rails way. This is my question, using orders and line_items as an example. An order has_many line_items A line_item belongs to order In my OrdersController I have def summary @orders = Orders.find(:all) render :xml => @orders.to_xml() end What I want to achieve is to
2006 Aug 16
11
just don''t ''get'' "has one" and "belongs to one"
Well, I understand what they do and how, I just don''t get why! It seems to me that any time you would have this relationship between two tables...they should be one table! Agile Rails book gives what seems to me to be a lame example for this. They use the example of an "invoice" and an "order". An invoice belongs to an order and an order has one invoice. Seems