Displaying 20 results from an estimated 20000 matches similar to: "Overriding Delete/Destroy in ActiveRecord"
2006 May 11
1
ActiveRecord collection_select and has_and_belongs_to_many
Hello everyone, first post to the list and a relative newbie to Rails
development. Done quite a bit of JSP, PHP, HTML, XML etc and thought I would
kick the tires on Rails to see if it can speed up development for internal
applications. Anyway, I am running into a problem that is just driving me
crazy and everything I read on the net doesn''t seem to help. I was hoping
someone here might
2006 Feb 16
1
Acts Plugin Howto''s (Other than the rails wiki)
Anybody know of some plugin howto resources other than the couple on
the wiki? Just looking for additional/supplemental info besides code
itself.
Thanks!
-Theo
2006 Mar 21
3
Newbie - ActiveRecord relationships
So I''ve worked through Agile Web Development with Rails and I''m now
trying my first little app to get into the swing of things. Its a task
tracking app where people can create tasks and assign them to others,
and also log time against the tasks.
I''m having trouble working out the model relationships. This is what
I''ve got so far, but its not right as
2010 Jul 04
1
Rails 3: ActiveRecord .include not working
Really no idea what''s up...
class Auction < ActiveRecord::Base
has_and_belongs_to_many :categories
end
class Category < ActiveRecord::Base
has_and_belongs_to_many :auctions
default_scope order(''title'')
scope :active, where(:active => true)
end
class CategoriesController < ApplicationController
respond_to :html, :json
# GET /categories/:id
2006 Jan 13
7
installing rails in vendor
Does a rails project automatically switch to using a "local" copy of
the rails libs if it exists in the vendor directory, or do I need to
tweak something else to pick it up?
Thanks!
-Theo
2006 Jan 29
2
WEBrick not starting
I''m running WinXP and recently upgraded to the most recent version of
rails. Unfortunately script/server gives me
Booting WEBrick...
Then it silently dies without starting. My previous version of rails
can still run WEBrick just fine.
Anybody seen this?
-Theo
2012 Jan 30
4
Reaching into a has_and_belongs_to_many - will :through work?
Hi. I''m hoping somebody can tell me that I''ve just gotten my syntax
wrong and I can in fact do what I want to do.
I''ve got a Group, and a Group has_many Campaigns.
Campaign has_and_belongs_to_many Users (and, naturally, vice versa).
So I''ve got a groups table, a campaigns table (that has a group_id), a
campaigns_users join table (with campaign_id and
2014 Aug 17
1
Overriding global voicemail options on a per-mailbox basis
All;
I'm currently using Asterisk 1.8 and I want to be able to have each user
be able to set as many of the voicemail options as possible. The
documentation calls voicemail options that can be overridden on a
per-mailbox basis "advanced options". However, I've read conflicting
information as to which options in the section [general] can be overridden.
According to
2015 Mar 14
1
Overriding dovecot.conf from Userdb Extras
> > I thought I read that anything from dovecot.conf can be overridden in a
> > userdb lookup. Or a passdb lookup with "userdb_" prefix.
> >
> > But I tried for fun change log_path but it never worked. Is that because
> > logging is special, already started logging before it comes to the
> > passdb/userdb lookups? So are there some dovecot.conf
2008 Dec 09
4
HABTM checkboxes insert but don't delete
I have a problem related with the HABTM relationships with checkboxes.
I''ve got a profile and a service model, both related with
has_and_belongs_to_many.
The problem is that i can insert new data in the profiles_services
table, however, i cant delete already existing data.
What could be the problem?
--~--~---------~--~----~------------~-------~--~----~
You received this message
2006 Jul 04
1
How to override ActiveRecord#base#destroy
Hello,
I have a database table with a primary key not being a simple id but
three columns. By overriding update() and create() I got Rails to work
with that table quit good. Except for the destroy() action. From the
resulting trace I can see that the old version of destroy() is called
from transaction.rb. I think this lines might be the reason that I''m
unable to override detroy():
2015 Mar 09
3
Overriding dovecot.conf from Userdb Extras
Hi,
I thought I read that anything from dovecot.conf can be overridden in a
userdb lookup. Or a passdb lookup with "userdb_" prefix.
But I tried for fun change log_path but it never worked. Is that because
logging is special, already started logging before it comes to the
passdb/userdb lookups? So are there some dovecot.conf settings
that cannot be overridden?
Thanks!
2006 May 16
4
Problems with multiple ''id'' columns in a join_table
I have a problem declaring a relationship through a join_table ; the SQL
generated by ActiveRecord is correct, but there are two columns called
''id'', and the final object gets the ''wrong'' column ...
Here''s a more detailed description of the data, code, and problem :-
There''s a People table, with id, name, and a few things.
Also a
2006 Jun 04
2
activerecord table help please
Hi everyone. I''m trying to figure out how to implement site-wide
tagging for my website. I have a rails-based weblog that supports
tagging posts. There''s a has_and_belongs_to_many relationship between
posts and tags. I''d like to now reuse those tags for tagging links as
well. Where I have a posts_tags table with post_id and tag_id fields,
I''d like to
2006 Nov 08
0
Prevent an object from being destroyed in HABTM relationship
Hello all,
I have the following models:
class Sku < ActiveRecord::Base
has_and_belongs_to_many :options
end
class Option < ActiveRecord::Base
has_and_belongs_to_many :skus
end
By default if I destroy an Option any relationships between Options and
Skus will be removed as well.
But, I want to prevent an Option from being destroyed when it is
associated with a Sku in the options_skus
2006 Jan 04
0
Re: DB Modelling the Rails way - solution by Chris Hall
Hi Chris,
Yesterday you kindly submitted an answer to my question on modelling
many to many relationships. I''ve briefly tried the proposed solution but
so far with no luck. Before I get too involved - I''d like to know if
mapping three way :join_tables is "legal" in a Rails sense. I only ask
since you put (untested) in your mail and I can''t find any docs on
2006 Apr 20
4
ActiveRecord: Many-to-Many problem
I am trying to make many-to-may relationship on classes Section and
Content.
Both Content and Section has:
has_and_belongs_to_many :contents and has_and_belongs_to_many :sections
and I have an exception when trying to access model properties:
"undefined method `add_contents'' for #<Section:0xb745c514>"
def add_content_entry
@section = Section.find(params[:section_id])
2015 Mar 13
0
Overriding dovecot.conf from Userdb Extras
Il 9 marzo 2015 alle 4.17 "E.B." <emailbuilder88 at yahoo.com> ha scritto:
> I thought I read that anything from dovecot.conf can be overridden in a
> userdb lookup. Or a passdb lookup with "userdb_" prefix.
>
> But I tried for fun change log_path but it never worked. Is that because
> logging is special, already started logging before it comes to the
2006 May 12
2
How to declare several HABTM-relationships?
Hello,
Is it possible to have several HABTM-relationships for the same object?
Example: Imagine I have 3 objects (classroom, student, teacher) and
define the associations for the student as:
class Student < ActiveRecord::Base
has_and_belongs_to_many :classrooms
has_and_belongs_to_many :teachers
class Classroom < ActiveRecord::Base
has_and_belongs_to_many :students
class Teacher <
2007 Jan 25
1
has_and_belongs_to won't delete records
Hi,
I have a has_and_belongs_to relationship between 2 objects, order and
product. I''m getting a foreign key violation when trying to delete
Order. Is there a special way of deleting orders without deleting
products? ("has_many" has :dependant => :delete_all.... does
"has_and_belongs_to" have something similar)
Trying:
Order.delete_all
Getting:
Mysql::Error: