Displaying 20 results from an estimated 200 matches similar to: "ActiveRecord: Many-to-Many problem"
2006 May 28
1
ActiveRecord: FK constraints problem
Hi all.
I have has_and_belongs_to_many association between models: Section and
Content.
class Section < ActiveRecord::Base
acts_as_tree
has_and_belongs_to_many :contents
belongs_to :default_content, :class_name => ''Content'', :foreign_key =>
''default_content_id'', :dependent => :nullify
end
class Content < ActiveRecord::Base
belongs_to
2006 Apr 18
6
Postgresql and ActiveRecords problems
Hi all. I have a problem with postgresql PK columns and ActiveRecord.
The error is: PGError: ERROR: null value in column "item_id" violates
not-null.
Ok, it''s wrong to insert NULL into PK columns, but rails doing it. How
to fix? So sad..
2006 Apr 21
3
Conceptual q about rails
Classes like activerecord, etc contains strange elements like
''belongs_to :something'', ''has_many :smth'' etc.. what is it? I can''t find
them in ruby lang documentation.. it''s similar to ''attr_accessor'' and
other costructions, how I can create my own constructions and how I must
understand them? Could anyone give me some links
2006 Apr 22
3
Gems installation into custom directory
I it possible to install gems into custom directory (user dir)? There no
any specific parameters in setup.rm I don''t wanna see unpackaged
binaries into my Debian system ;) Or maybe someone can send me a link
with .deb''s?
Thanks in advance.
2006 May 18
4
WebServices and DateTime - 3 elements of civil date are necessary
I simply trying to receive an array of objects, retrieved by
ActiveRecord from table with datetime column and I have:
test_list(SoapControllerApiTest):
ArgumentError: 3 elements of civil date are necessary
/usr/lib/ruby/1.8/date.rb:1214:in `new_with_hash''
/usr/lib/ruby/1.8/date.rb:1258:in `parse''
....
It''s a bug or I am wrong somewhere?
2006 Apr 23
4
ActiveRecord: Exclude some columns while fetching
I have models with large TEXT, BLOB columns and I don''t wanna fetch them
everytime. Is it possible to omit columns when fetching records from DB?
Sorry, if it''s trivial, but I can''t find helpful information in docs.
2006 Aug 06
2
better_nested_set plugin
Hi,
I''m pleased to announce that the better_nested_set plugin is released.
It ehances acts_as_nested_set, adding methods to move parts of the
tree, like:
* move_to_child_of
* move_to_right_of
* move_to_left_of
Pass them an id or an object.
Other methods added by this mixin are:
* root - root item of the tree (the one that has a nil parent;
should have left_column =
2006 Jun 16
3
ActiveRecord, using sql functions for some attributes
Hi.
I need to use functions INET_ATON, INET_NTOA for IP address retrieving.
Is it possible to make this transparently (without custom SQL for
saving, updating and retrieving)?
2006 May 05
1
link_to - passing parameters
Hi. Is it possible to compose GET request using ''link_to'' and get passed
params like: params[:foo][:bar]?
2006 Dec 09
1
manipulate headers?
Hi...
Here''s a working Perl script that I want to be able to do in Ruby:
use WWW::Mechanize;
my $url = "http://host/tt?name=chris";
my $mech = WWW::Mechanize->new();
$mech->add_header( Referer => "http://chrismcmahonsblog.blogspot.com" );
$mech->add_header( Cookie => "messageid=170118; memberid=1007");
$mech->get($url)
so the header
2005 Apr 23
7
Validation question
Hi all,
Is there a way to invoke validations at times other than save, create
and update? I know that I can do this by writing my own validation
checks using errors.add_[blah], but I''d like to leverage the existing
validation code.
What I have is two sets of fields in a record, set A and set B. Both
sets must be validated on record create. However, the trouble is that
after
2005 Apr 08
1
TrustedNodes option in TINC
Hi,
We want to deploy a tinc VPN, with more than 50 sites connected all
arround the world. But we cannot trust all our sites with the same
level, so the tinc solution (automatic full mesh) is "too automatic" for
us : *any* node can add a new node which will be connected directly to
others.
A solution could be TLS (signing public keys), but create a PKI is
another issue for us.
2016 Jan 19
5
Building SVN head with CMake - shared libraries?
On 01/17/2016 02:53 PM, Dan Liew wrote:
> @Brad: CC'ing you because I know you use
> ``llvm_map_components_to_libnames()`` so you will likely have
> something to say about it breaking.
I'm using it in CastXML but that could easily be adapted to something
different if needed. The larger concern is that that API is the
documented way to use LLVM in an application with CMake so
2006 Mar 23
2
Way to iterate over each associtaion
Is there a way with ActiveRecord to get ahold of a collection containing
each association? I want to write a rake task that will dump a model and
all its related models to yaml.
Thanks,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060323/abdf4305/attachment.html
2006 Aug 02
2
Problem with date_select
Hi all.
I have a big problem with date_select helper, because i guess it can''t
resolve local variables to set correctly selected date.
Small example:
<% @client.charge_regs.each do |creg| %>
<%= form_remote_tag with_progress(:url => { :action => ''foo'' }) %>
<%= date_select ''creg'', ''valid_before'' %>
2006 Aug 04
1
ActiveRecord, Mysql, NULL columns and uniqueness
Hi all.
Mysql allows to set multiple NULLs on columns with unique constraint,
it''s normal SQL. Well, but when I try to submit some form, all
unspecified values will be consodered as '''' (empty string) and
(Mysql::Error: Duplicate entry occurs (((. How I can teach ActiveRecord
to consider empty fields as NULL?
2006 Jun 02
1
Ajax: update multiple DIV''s
Hello.
Is it possible to update multiple DIVs during? For example I have DIV
for @flash[:notice], and one for content and I need to render both DIVs
after executing action.
2006 Jun 07
2
Ajax: periodicaly_call_remote problem
Hello
I am using ''periodically_call_remote'' to get some stats from database
and display it every N seconds, it''s works fine, but when I rewriting
(by page.replace ...) content of the DIV which contains
''periodically_call_remote'' definition request are still executing...
How to fix this confuse?
Thanks in advance.
2006 Jun 30
1
Retrieve table names
Hi.
Is it possible to retrieve list of tables from database? I know about
"show tables" (mysql) but I wanna keep application code independent from
database server. I can''t find anything in rails activerecord docs...
maybe someone know how? Maybe some plugins exists?
Thx.
2006 May 13
3
ActiveRecord and cascade removing
Hi. Please help me how to make cascade delete for this 3 classes:
class Section < ActiveRecord:Base
has_many :ad_bindings
has_many: banners, :through => :ad_bindings
end
class AdBinding < ActiveRecord:Base
belongs_to :banner
end
class Banner < ActiveRecord:Base
end
When I remove Banner, I need to remove AdBinding also, but it still
stored in database. Where I wrong?