similar to: object.save is not creating an insert statement

Displaying 20 results from an estimated 500 matches similar to: "object.save is not creating an insert statement"

2008 Jul 04
4
Routing and Parameters
Greetings. I have a route something like this: map.calendar ''/tasks/:year/:month'', :controller => ''tasks'', :action => ''calendar'', :year => /\d{4}/, :month => /\d{2}/ (Ignore the obvious problems of invalid data.) I''m trying to create a form that will allow my users to navigate from one month/year to the next.
2007 Jul 12
3
Agh, this is annoying. Why is this happening?
My problem: Mock ''Task_1005'' received unexpected message :user_id= with (1) No matter what I do to try to stub that out it will still fail out and give me that message. Here is my spec describe TasksController, "handling POST /tasks" do before(:each) do @task = mock_model(Task, :to_param => "1", :save => true)
2007 Dec 20
2
turn off auto-seek extention - force use timeout
I have an application where a call-in user is prompted to enter an identification number for schedule information. That id number is setup as an extension, and if that extension doesn't exist, it tells them that they are not scheduled, then loops back to ask for the id number again. My problem is that asterisk pre-emptively goes to the i extension (invalid) too early depending on available
2006 Feb 22
9
acts_as_habtm_list plugin
I''d like to announce acts_as_habtm_list plugin for rails. acts_as_habtm_list is a Ruby on Rails plugin, that can manage ordered lists through a join-table. It is providing almost the same Api as acts_as_list. The position column has to be defined in the join table. You can find additional information at: http://www.inlet-media.de/acts_as_habtm_list/ Install it executing this command
2006 Mar 22
10
Need for multiple acts_as_list
I have a model "Childmodel" that belongs_to two other models "Parent1" and "Parent2". "Parent1" "has_many :childmodels, :order => :positionp1" and "Parent2" "has_many :childmodels, :order => :positionp2". i.e. The child is independently positioned within each of its parents. This works fine and gets me the useful
2006 Jan 16
3
routing to controller inside module
Hey, am i to stupid to find the information about how to route to a controller in a module? Maybe module support has gone! The controller is under: app/controllers/admin/my_controller.rb The my_controller.rb file looks like this: module Admin class MyController def index render :text => ''Hello!'' end end end How does a route to all controllers under module
2008 Dec 19
3
Delete All action
Hi, What is the best way to delete all members of a model? For example I have a tasks model and want to put a link in that will delete all tasks at once. Something like, @tasks = Task.all @tasks.each { |task| task.destroy } Do I need another action for this, and what should the link to it be? cheers, DAZ --~--~---------~--~----~------------~-------~--~----~ You received this message because
2006 Mar 15
4
help with DRY violation
I''m trying to be a good rails developer and fix DRY violations as i find them. However, i''m trying to fix this one, i cant seem to get it to work. I have two tables A and B that have a one-to-one relationship. Table B belongs_to Table A. Table A has_one Table B. I''m creating instances of Table A in different places, depending on the controller. However, for each
2006 Mar 21
13
Double and single quote usage in AWDWR
Hello everyone! I''ve noticed, that the book uses double quotes almost everywhere. It is like <%= javascript_include_tag "prototype" %> I''ve checked the "programming ruby, 2ed" book and found that double quotes are most suited when escape sequences and substitutions are required. Isn''t it more semantically correct to write this code like
2006 Mar 04
4
Submitting data to two different tables with two different models
I''m very new to Rails. I''ve been reading Agile Web Dev for a while and read up on ruby, but I''m still learning. I designed a website for someone for an engineering shop. New projects had to be added manually. Well, I figured this would be a great canidate for railifying! I have the form working perfectly, you can add your data and get it in a table, and listing
2006 Mar 14
8
email address parse
hi all how to parse such email string to a array: #-------------------------------------------- "joe black"<joe_1@joe_black.com> joe_2@joe_black.com, joe_3@joe_black.com #-------------------------------------------- seems emails from user input include various format. and i have to split them to a array. any idea? regards. -- Posted via http://www.ruby-forum.com/.
2014 Apr 04
3
Samba AD - Unix attributes problem
Hi, I've recently started using Samba4 (Sernet binary, 4.0.16 on Centos 6) as PDC. I would like to assign unix attributes using MMC console "Active Directory Users and Computers" however every time I'm trying to do this I get an error "Unable to modify the object property values. Check your credentials. There could be a network problem blahblahblah".. I've
2006 Mar 08
3
List and update values from text_field_tag fields
Hi, I populate a couple of text_field_tag''s with data from an AciveRecord object. Some fields are editable and at the end of the page there''s a submit button. I want the new values to be updated in the DB but by default my original values are stored again. How do i go about doing this? thanks/jens AIM: jens.tinfors@mac.com Skype: jtinfors
2006 Mar 13
3
validates_associated problem
Hello, I have a situation where an ''employee'' belongs to a ''department'' and have setup the relationship as follows. class Employee < ActiveRecord::Base belongs_to :department, :foregin_key => "department_id" validates_associated :department_id end class Department < ActiveRecord::Base has_many :employees def validate_on_update
2006 Apr 13
2
Rail''s basic idea
Hallo, what links would you recommend for an advanced programmer, who wants to know something about the basic idea and architecture of Rails. That''s no question for tutorials or howtos, but rather for theoretical documents and field reports. Can you help me? -- Norman Timmler http://blog.inlet-media.de
2006 Mar 23
3
Newbie: ''find'' across multiple relationships
For security purposes, I often want to find objects that are ''visible''. e.g. class Person < ActiveRecord::Base has_many :x end ... @person.x.find(params[:id]) as opposed to X.find([params[:id]). Simple enough for me. My question: Say we have - class Person < ActiveRecord::Base has_many :x, :class_name ''Z'', .... has_many :y, :class_name
2006 Feb 22
3
[OT] Email line separator
What line separator do you use when composing emails? 1. \n 2. \r\n 3. \r Is there a ''official'' line separator for emails (rfc-document?)? What separator is the most compatible between Windows, OS X and Linux? -- Norman Timmler http://blog.inlet-media.de
2006 Mar 24
19
Storing images in Ruby
Hi, I''d like to allow users to upload images and store those images in a Postgres database. I''ve looked through the example in "aguile development with rails" which suggests using the MySQL blob field. When I wrote a similar app in Java, we Base64 encoded the file and then stored it as a text field. Is this easy to do in RoR too? Any advice you can give me would
2008 Jul 11
4
how to debug using rspec stories
Hello. I just started to use rspec stories. I followed the following tutorial: http://www.tomtenthij.co.uk/2008/1/25/rspec-plain-text-story-runner-on-a-fresh-rails-app So I implemented my story and some of the steps are: (...) When "user creates a product" do post "products/new", :name => @name end Then "there should be a product named
2006 Feb 28
6
Log Files in View
Is it possible to display the log files in the view? Thanks in advance. -- Posted via http://www.ruby-forum.com/.