Displaying 20 results from an estimated 1000 matches similar to: "issue with deprecatiing push_with_attributes"
2006 Mar 15
1
push_with_attributes not inserting default values
I have a join table A_B with columns[a_id, b_id, c_data default 1,
d_data default 1].
If I do:
@aobj.bobjs.push_with_attributes(@bobj,{:c_data => 0})
I find that the row inserted, has d_data set to 0 and not the default
value specified in the database, which is 1. So I am having to
explicitly set it using :
@aobj.bobjs.push_with_attributes(@bobj,{:c_data => 0, :d_data => 1}).
Is this
2005 Mar 13
1
Semantics of push_with_attributes
In trying to add timestamp support to habtm, I''ve stumped on a question
which I hope you all help me solve.
And that is, when adding a record twice to the list of associations with
push with attributes, should the following test succeed or not?
def test_pushing_twice
dev = Devel.new("name"=>"victor")
p =
2006 Jul 31
1
Use of push_with_attributes
Hi,
I have a model class called Page and a corresponding pages table in the
db.
Is there a way to do Page.new without actually creating a corresponding
record in the table? I want to set some values in it and then pass it to
the add_content_component() method in the class below which calls
push_with_attributes() which will actually create the record in the db?
class Page <
2006 Jun 05
7
Is HABTM Dying?
For a while, I''ve been getting that HMT is replacing HABTM. It appears that
HMT can do all of what HABTM can do and more. The question is: Should I stop
using HABTM? Let''s take a simple case:
A case has many categories
For a given category, there are certain valid statuses
Category
has_and_belongs_to_many :statuses
Status
has_and_belongs_to_many :categories
Question:
Is
2006 Jan 02
1
ActiveRecord, << or push_with_attributes: update if exists?
In the Agile Rails book, on page 232 (PDF, 4th edition) there is an
example of (within ActiveRecord) marking an article as read by a user at
the present time. Short example code (from the book) here:
class User < ActiveRecord::Base
has_and_belongs_to_many :articles
def read_article(article)
articles.push_with_attributes(article, :read_at => Time.now)
end
# ...
end
2003 Jun 03
1
how i install smba!!
hi users!
i'm trying to Install a new version of samba (samba-2.2.8a) since tree
days!
i have a Suse linux 8.2 Server and in my Server run alredy samba-2.2.7 (
smbd and nmbd run in /etc/samba)
I 'v installed and configured now samba in the /usr/local/src/samba-2.2.8a/
directory
like this :
./configure --sysconfdir=/etc/samba --localstatedir=/var/log/samba --mandir
=/usr/local/man
2006 Jan 02
2
ActiveRecord:
In the Agile Rails book, on page 232 (PDF, 4th edition) there is an
example of (within ActiveRecord) marking an article as read by a user at
the present time. Short example code (from the book) here:
class User < ActiveRecord::Base
has_and_belongs_to_many :articles
def read_article(article)
articles.push_with_attributes(article, :read_at => Time.now)
end
# ...
end
2006 Apr 29
5
HABTM - how to insert join row when associated rows exist
I have successfully used HABTM to create a many-to-one-to-many set of
rows in one step. Now, if two objects I want to associate already exist,
how do I create the join row? The Agile book mentions the
''push_with_attributes'' method. The text says this method is useful for
adding additional attributes to the join row (in the example a ''read_at''
timestamp). I
2005 Dec 15
2
efficient INSERTS
Hi,
I''ve got the following models:
Company
Package
with a habtm relationship.
In my controller, I have a ''dispatch'' action which does the following
@companies.each do |company|
@packages.each do |package|
company.packages.push_with_attributes(package, :sent_on => Time.now)
end
end
my table ''companies_packages'' therefore lists which
2010 Mar 19
2
migration
Hi all,
I have migrated with some tables in my application. After some days i
need to add few more tables to database. The initial tables in database
have some data. when i try to migrate the database for second time with
rake db:migrate it is saying the alredy table exist <table name> and
rake is aborted. i dont want to loose the old data and i want to add new
tables to alredy exiested
2006 Mar 01
6
How to retrieve attributes from HABTM?
We have tables Users and Communities linked by has_an_belongs_to_many.
The join table Communities_Users has additional fields [ is_active,
is_blocked, join_date] etc. These are populated using
@user.push_with_attributes(:is_active => true,...).
Later on how do we update or retrieve the attributes in the link table
for a given user or a community with doing it explicitly using SQL?
Thanks,
2008 Oct 31
4
offtopic question .. apprecyice ur help
Dear All,
its a offtopic question but really apprecite if someone would advise n help
i have been running a mil server with sendmail
and have sbl-xbl.spamhaus.org as my dnsbl.
i had other servers which are alredy out now
that is relays.ordb.org and dsbl.org have already been out of my sendmail
config.
any one knows of ny other servers i could add in my sendmail config
apprecite ur help
2009 Jul 02
2
compose_primary_keys
I´m looking for a way to work with compose primary keys.
I alredy know that plugin http://compositekeys.rubyforge.org/
but it doesn´t have examples.
Please help =]
--
Horus Augustus C. C. Lima
Sagarana Tech
Mobile +55(85)8842.4402
Desk +55(85)3304.6530
augustus-b3GZhX+fmr6XmMXjJBpWqg@public.gmane.org
http://www.sagaranatech.com
--~--~---------~--~----~------------~-------~--~----~
You
2004 Apr 08
2
i'm looking for reference guide for Skinny SCCP
Hi all,
I'm writing my graduation theses : analysis VO-IP protocols , and I cannot
find any documents about Cisko Skinny Client Control Protocol. I have Cisco
CallManager and some IP-phone and I'm sniffing traffic between that, but I
don't understand, how this protocol works. Clearly i'm looking for
description of SCCP commands and explanation some basic SCCP scenarios or
what
2006 Jan 06
2
Budge Tone-100 as a Ext in the LAN
HI ,
I installed asterisk in fedora core 3 machine perfectly. and i have 10 units of GrandStream IP phone ( Budge Tone-100 ) . I wanted to know how can i use it as extentions in my LAN ? Asterisk PBX alredy there. I didn't try to do any configurations of any files .
What are the configurations has to be made with asterisk ?
Thanx in advance,
Luke.
Send instant messages
2006 Mar 19
1
How to access atributes from a join table?
I have a table "domains", "users" and a join table of "domains_users"
which has the domain_id, user_id as well as a userlevel_id attribute.
I know that in the model User class I can set the value of this
attribute with a function that calls:
domains.push_with_attributes(domain, :userlevel => 1)
but how do I access the userlevel field so that I can use it later
2005 Mar 08
1
Updating Join Attributes
Other than doing a raw SQL update the only way to update join
attributes is to remove an object and then push_with_attributes
correct?
--
Lon
2006 Feb 07
1
habtm :uniq causing duplicate inserts? How to update Rails?
Hello *Gem* experts,
Sorry for asking multiple questions in one post but they are both related to one problem.
So far I have the following code:
class Member < ActiveRecord::Base
has_and_belongs_to_many :blogs, :uniq=>true
.....
end
class Blog < ActiveRecord::Base
has_and_belongs_to_many :members, :uniq=>true
...
end
The issue is that
2006 May 06
3
Storing additional data on join tables with Rails
Hi there
I need to store additional attributes on join table. Searching the
Wiki [1] revealed two possible methods:
1) push_with_attributes, as described by Justin Palmer [2].
Unfortunately, "this method is now deprecated" [3]. Even if it wasn''t,
there seem to be inherent problems with that approach, for example
with updating those additional attributes, though Joshua Muheim
2015 Jan 05
3
Re: [PATCH 5/5] New API: btrfs_filesystem_set_label
In data venerdì 26 dicembre 2014 16:17:49, Hu Tao ha scritto:
> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
> ---
> daemon/btrfs.c | 33 +++++++++++++++++++++++++++++++++
> generator/actions.ml | 16 ++++++++++++++++
> src/MAX_PROC_NR | 2 +-
> 3 files changed, 50 insertions(+), 1 deletion(-)
>
> diff --git a/daemon/btrfs.c b/daemon/btrfs.c
> index