Displaying 20 results from an estimated 60000 matches similar to: "Help with acts as paranoid"
2007 Aug 03
0
acts_as_paranoid and Association Extensions (has_one troubles)
Hi... Isn''t there a proper way or hack/workaround for the following?
* For the example with unfortunate disabilities.. look below,,,
Usage of has_* (associationmethods) do {def with_deleted
AccociatedModel#with_scope} {Paranoid''s#find_with_deleted}...
The has_one associations give me a nil object when invoking it with
Model.association_OBJECT.with_deleted. Has_many does like
2007 Jan 08
2
Two problems with Acts_as_paranoid
Hi,
I''ve run into two small problems with acts_as_paranoid and wondered if
anyone else has experienced them as well (and if yes, if they have any
solutions).
1. When using has_many :through, AAP doesn''t seem to take into account
the fact that your join model might also be paranoid. My solution to
this at the moment is to add an explicit conditions clause to the
has_many
2006 May 11
0
acts_as_paranoid, aliasing and nested scopes in Rails 1.1
I have a real problem with the acts_as_paranoid plugin. The aliasing of
find and so the nested scope does not seem to work at all, when
combining it with similar plugins.
The description:
I made a copy of ''acts_as_paranoid'' in the plugin directory, renamed it
to ''acts_as_very_new''(just a nonsense plugin for testing), and
simplified the code (original code
2013 Jun 15
1
A puzzle about default_scope
Hi, guys
I have a puzzle about default_scope.
Suppose I have two model:
class User < ActiveRecord::Base
has_many :blogs
default_scope where(deleted_at: nil)
end
class Blog < ActiveRecord::Base
belongs_to :user
end
I want to produce sqlselect blogs.* from blogs inner join users on users.id
= blogs.user_id and users.deleted_at is null
And the code Blog.joins(:user), which I think
2006 Mar 14
2
acts_as_paranoid and :include
Will the find from acts_as_paranoid filter down to an :include?
For instance
class parent
acts_as_paranoid
has_many: children
end
and
class child
acts_as_paranoid
belongs_to :parent
end
Then if you
Parent.find(:all, :include => children)
you will get all the children if they are deleted or not. I guess the find
that filters out the deleted_at is null does not filter down to the includes
2008 Oct 14
1
Starting Server gives an error
Hi,
I had created a new environment and tried to start the webrick server
for that environment but it is giving an error:-
E:/demo/vendor/rails/railties/lib/commands/servers/
webrick.rb:11: warning: already initialized constant OPTIONS
E:/demo/vendor/rails/activesupport/lib/active_suppo
rt/dependencies.rb:249:in `load_missing_constant'': Expected E:/Demo
2007 Jul 30
3
SortHelper problem
I have TableA with name, description, start time displayed on one page.
TableB has name, comment, file path and is displayed on another page.
I''m using the SortHelper2 helper to help me sort the columns of these
tables, however I''m experiencing a problem whereby if I sort TableA by
description and then go ahead and view TableB I get an error message
saying SQL Command Failed,
2008 Sep 25
1
Will acts_as_paranoid work with attachment_fu?
I''ve got a problem in that users are deleting a paranoid model through
the application, including dependents. Some of these dependents are
paranoid too, but not the attachments. (I''m using DB file storage.) I
need to be able to un-delete these things and I''m now wondering if
acts_as_paranoid will work with models that use attachment_fu? If so, in
what model to I add the
2012 Jul 05
2
Addition to has_many - a ':source_scope' option
Was looking to work on a small addition (to has_many) which will be useful
to me and others alike. A few technical details about the addition:
Basically wanting to have something like,
has_many :subscribers, through: :subscriptions, *source_scope:* :deleted
We currently have to do this in our code as,
has_many :subscribers, through: :subscriptions, conditions:
2007 Aug 29
4
Turn of dependencies so that a destroy will not destroy chil
Hello,
Can i turn of dependencies so that a destroy on one table will not
automatically destroy data in the child table?
Thanks
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
2013 May 27
3
Ransack, acts-as-taggable-on and checkboxes in search form
need some help on ransack filtering.
I have model Project, which has many tags through acts_as_taggable gem.
Project.rb:
class Project < ActiveRecord::Base
include PublicActivity::Common
belongs_to :customer
belongs_to :category
has_many :attachments, :as => :attachable
has_many :reports, :dependent => :destroy
has_many :messages, :dependent
2006 Mar 24
6
Should counter_cache fields be saved in the database?
As far as I can tell, the counter_cache option on a belongs_to model
doesn''t actually save anything in the database. For example, I have
the following models:
class Parent < ActiveRecord::Base
has_many :children,
:conditions => "deleted_at IS NULL"
end
class Child < ActiveRecord::Base
belongs_to :parent, :counter_cache => true
end
With the following
2010 Aug 19
1
Composite primary keys and :joins=>
I have a legacy db with the following simplified structure:
Table-A:
type_key, code_key, name, ... # PKs are type_key and code_key,
there is no id col and I cannot alter this db
Table-B: # each row has only the code as a foreign_key, the type_key
is hard-coded to "FOOKEY"
an_id, code, ...
Models:
class TableB < AR::Base
set_table_name ''table_b''
2008 Feb 13
4
Migration Issues: Can't update newly added column values
Hello everyone, just wondering if anyone can help me with a migrations
question here.
Using:
rails 2.0.2
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin]
mysql 5.0.45
Platform:
windows xp
The problem:
----------
I created a migration that is designed to add a column named
"deleted_at" (timestamp) and then remove a column named
"is_deleted" (boolean). The idea is to
2004 Jul 21
1
Bug#260573: logcheck: ignore.d.paranoid/cron and ignore.d.server/cron swapped
Package: logcheck
Version: 1.2.23
Severity: normal
Hello,
I have:
# /bin/cat ignore.d.server/cron
^\w{3} [ :0-9]{11} [._[:alnum:]-]+ crontab\[[0-9]+\]: \([[:alnum:]-]+\) LIST \([[:alnum:]-]+\)$
^\w{3} [ :0-9]{11} [._[:alnum:]-]+ crontab\[[0-9]+\]: \([[:alnum:]-]+\) REPLACE \([[:alnum:]-]+\)$
and:
# /bin/cat ignore.d.paranoid/cron
^\w{3} [ :0-9]{11} [._[:alnum:]-]+
2006 May 15
0
Insert database into two tables.
Hi All,
I have problem with inserting new record into the database.
I have a form has 4 fields, and two fields will be inserted into tableA,
and other fields will be inserts into tableB.
These two tables has relationship tableA(One) and tableB (Many) ...so
how could I do that?
Socheat Yi
Web Programmer/Software Developer
Screened Images Multimedia (SIM)
*If You Can Imagine It...We Can
2006 Jul 14
3
compare two tables and find the difference?
I need to compare a column in TableA to a column in TableB and then
select 3 columns from TableA for all the records in TableA that don''t
exist in TableB.
TableA and TableB are different but do have one field in common that i
am comparing. The tables are not related in anyway.
right now I have a find_by_sql query located in a model that looks like
this:
def self.absent_charges
2011 May 08
5
Am I being to paranoid?
Hi All,
I want to know thoughts on if I am being to paranoid/security conscious.
CentOS 5.6, Apache, MySQL, running an Firewall in front of everything and obviously the built-in firewall on the box. I have ssh on a different port and starting to use Keys instead of password authentication. I host an intensive website and I am getting about 150 unique visitors per day.
What I am seeing is
2006 Jul 10
0
Strange acts_as_paranoid behavior
Using the acts_as_paranoid plugin with rails 1.1.4 (model also uses
acts_as_threaded and acts_as_taggable) and getting some unexplainable behavior.
The following tests:
assert_equal Conv.count, num
assert_equal Conv.count_with_deleted, CONVS_TOTAL
Produce the following SQL:
SQL (0.000000) SELECT count(*) AS count_all FROM convs WHERE ((
convs.deleted_at IS NULL OR convs.deleted_at
2012 Mar 29
2
subtract a list of vectors from a list of data.frames in an elegant way
Dear R experts,
I've realized that it might not be possible to define a negative SELCET statement in a SQL call so now I'm looking for the smoothest way to generate a list of what I would like from my large database by first pulling all the names with a query like this "SELECT top 1 * FROM your_table" (thank you Bart Joosen for the idea) and then subtract the variables I am not