Displaying 20 results from an estimated 4000 matches similar to: "Rails ActiveRecord associations autosave option"
2012 Jul 10
1
has_many association with autosave issues
I''d like to use autosave => true for an association for its added benefits:
the parent doesn''t save unless the children saves. However, it seems to
skip validations when saving the children. And this seems to be the case
since the beginning of time...
Anyone know why?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2009 Mar 10
0
autosave no longer a valid option for belongs_to?
The Rails API doc (api.rubyonrails.org) says that :autosave is still a
valid option for belongs_to in the latest version of Rails. However, a
look at the activerecord/lib/active_record/associations.rb (line 1590)
reveals that it is not in the @@valid_keys_for_belongs_to_association
array. I also noticed that it''s not in the ActiveRecord API doc
(ar.rubyonrails.org).
Does anyone have any
2012 Mar 15
0
Make Asset Pipeline compatible with Chrome DevTools Autosave
https://github.com/NV/chrome-devtools-autosave doesn’t play nice with Asset
Pipeline. https://github.com/NV/chrome-devtools-autosave/issues/27
The culprit of the problem is in the asset’s URLs. I cannot decipher a file
path by its URL. For instance, /assets/main.css?body=1 could be either
app/assets/stylesheets/main.css, lib/assets/stylesheets/main.css
or vendor/stylesheets/main.css.
To fix
2007 Aug 10
2
DO NOT REPLY [Bug 4873] New: rsync transfers stop when encountering Emacs autosave files with hash signs
https://bugzilla.samba.org/show_bug.cgi?id=4873
Summary: rsync transfers stop when encountering Emacs autosave
files with hash signs
Product: rsync
Version: 2.6.9
Platform: x86
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P3
Component: core
AssignedTo:
2010 Dec 29
3
Windows editor suggestions - autosave
I am looking for advice on an editor to use with R (windows) that has an autosave feature. I typically write scripts using the RGui (and tried TinnR yesterday) but I am having continuing problems with BSODs (non R related) and have in the past have had issues with R crashes and would really like a system that does not require me to remember to hit the save button on my script every 10 minutes so
2006 Jun 19
3
Strange behavior of :through association.
class Host < ActiveRecord::Base
belongs_to :person
end
class House < ActiveRecord::Base
has_many :people, :dependent => true
has_many :hosts, :through => :person
end
class Person < ActiveRecord::Base
belongs_to :house
has_many :hosts, :dependent => true
end
Now when I try to do:
@hosts = House.find_by_id(params[:namas]).hosts
from my controller I get this:
1999 Sep 12
0
Just a thought ...
Dear all
As someone who leaves his R session open for days - even longer - because
only I access the computer it is on, I very occasionally crash it (my most
recent success was to use a very long plot() which it turned out have both
'l' and a 'b' without keyword!).
I try to be careful, preserving essential bits of coding in an adjacent
emacs screen and doing save.image() from
2006 Jul 30
1
Bug? find_by_id(nil) returns object just created
Tried to submit a ticket in Trac, but it reported an error...
Doing a Model.find_by_id(nil) after creating an object of type Model returns
that object -- and the next time, returns nil. It should always return nil.
For example,
Step 1. Create an object:
>> Foo.create(:name => "bar")
=> #<Foo:0x2aaaac3ade20 @new_record=false,
2006 May 17
2
ActiveRecord::Associations ER diagram/macros
Hello,
I found an interesting ER diagram on the "Module:
ActiveRecord::Associations::ClassMethods" page of the Rails Framework
Documentation :
http://ar.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
At the beginning we can read ? Associations are a set of macro-like
class
methods for tying objects together through foreign keys. They express
relationships like
2006 Mar 02
1
ActiveRecord in modules & associations
I''d like to organise my active records into modules but can''t get the
associations to work. The doc says that associations within the same
module should work. I''ve tried using the class_name option too but still
doesn''t work.
Can anyone help?
For example
module Mod1
class Animal < ActiveRecord::Base
has_many :dogs, :class_name =>
2005 May 14
2
ActiveRecord::Associations::ClassMethods Documentation Issue
I''m curious, but isn''t this example in the documentation for
ActiveRecord::Associations::ClassMethods somewhat counter-intuitive? The SQL
DDL is correct for the way it''s used in the models. But isn''t it more
logical that an author would have many posts, rather than many authors
having one post?
From
2006 Jan 26
1
Explanation on Activerecord Associations
A while back, I had some doubts on the use of associations. I still
haven''t got a satisfactory guidance so that I can spring ahead with the
project. I am trying to understand from a ruby point of view on doing
things. Basically I have a controller that gives me a list of students.
And each student may have say home address and mailing address. Hence I
can model as shown below. How do I
2006 Jul 13
2
find_by_id(nil) does not always return nil
I have a model named User. When running this application from the
console I can call User.find_by_id(nil) and it returns nil. When running
this application during testing or through WEBrick or Mongrel calling
User.find_by_id(nil) returns the newest record in the database. But it
only does this the first time you call it with nil. The second time you
call User.find_by_id(nil) it returns nil.
2013 Nov 30
1
Need good tutorial on ActiveRecord associations
Hi,
I am very new to rails.. I am having hard times to understand the
ActiveRecord associations.. I tried
http://guides.rubyonrails.org/association_basics.html .. But it is not
for beginners. :)
Is there any good tutorials, to understand the concept?
Thanks
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on
2006 Nov 27
2
changing activerecord associations at runtime
Is there any way to change the associations of a model at runtime,
like before running a specific query?
Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this
2006 Feb 02
0
proposed bugfix/patch: ActiveRecord cross-module associations
Hi,
I''m still test driving the improved support for module namespaces in
rails and I''ve hit a problem with associations between AR classes in
modules and AR classes in the root namespace.
The long and short of it is I want to be able to say:
Foo::Bar.belongs_to :wibble, :class_name => "::Wibble"
If you don''t try to prefix ''Wibble''
2005 Jul 28
0
ActiveRecord, computed values, and associations
Is there some sort of good pattern for dealing with computed values with
Rails/ActiveRecord?
A simple example: 3 tables, classes, students, and student_class_records
(habtm style relation but contains a good deal of additional state so is
modeled explicitly)
Something like select the 10 classes with the most students. Easy enough
in SQL. So I''m using a lot of find_by_sql and
2008 Feb 22
2
marshaling ActiveRecord objects: how to unload associations?
I''m marshaling ActiveRecord objects, and I want them to be as small as
possible. How can I unload everything that can be reloaded from the
database?
If they''re marshaled before any of the associations are referenced
then the referenced objects aren''t dumped. But if the association has
been loaded, how can I unload it? AssociationProxy.reset doesn''t seem
to do
2006 Apr 28
0
ActiveRecord associations -- when to use force_reload = true
If an Order has_many Items, when do I have to call order.items(true)
instead of just order.items to get the current list of items ?
In Rails 1.1 if I call some_item.destroy, the order.items list doesn''t
get updated unless I call order.items(true) -- this does not happen in
Rails 1.0.
Also when I add items to an order the list may or may not get updated
depending on the Rails version
2006 Jan 19
0
Activerecord | Understanding associations
I have 3 tables
feeditems{
id,
feedname,
timestamp
}
tags{
id,
name,
feeds_id
}
how do I retrive the last 10 feeditem entries and its tags? I know this
is simple but am all confused. Any help is greatly appreciated.
Thanks!
Newbie!
--
Posted via http://www.ruby-forum.com/.