similar to: ANNOUNCE: act_as_soft_deletable - new rails plugin for soft deleting / disabling ActiveRecord models

Displaying 20 results from an estimated 3000 matches similar to: "ANNOUNCE: act_as_soft_deletable - new rails plugin for soft deleting / disabling ActiveRecord models"

2008 Oct 28
7
aasm callback order?
Hello! Sometime ago I ran across a webpage where someone had identified the full callback sequence for an object lifecycle including AASM with it''s :enter and :exit and whatnot callbacks. Unfortunately, I can''t find it and searches don''t seem to help. Does anyone have a reference to a page that shows the callback sequence with Acts As State Machine (the gem)? I think
2006 Jan 16
5
Soft Deletes
How would I go about setting up my rails applications to soft delete items from the database rather than actually deleting it. I would imagine that I need to over ride the methods from ActiveRecord. Where would I do this would it be in the model? enviroment.rb? I would imagine that if i wanted it throughout my entire application it would need to be in the enviroment.rb. Also to
2005 Nov 15
1
acts_as_paranoid --> undefined method `constrain' for class `Class'
Hi All, So I thought I had this acts_as_paranoid problem previously and fixed by going to rails 0.14.2, although I''m not 100% it was the same thing. I''m now on rails 0.14.3 and I''m getting: undefined method `constrain'' for class `Class'' for any model that includes acts_as_paranoid. My application trace is below. Has anyone else got this and know a
2005 Nov 03
12
Installation of plugins/gems/mix-ins confusion
I''m running 0.14.2 and am a little confused as to the best way to install mix-ins. I''m specifically using "acts_as_paranoid" as an example (as it is one of the simpler implementations). It is a gem and can be "installed" as a gem, but then what''s the best way to integrate it into my app (require_gem?). I''ve seen recommendations to require it
2008 Apr 16
3
Linking to "Next Entry >>" from the current Entry Page
Hi all, I''m trying to link to the "Next Entry >>" from the current entry page (in show.html.erb). Any one know how I would do it? -- 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
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
2005 Dec 11
4
Problem with acts_as_paranoid: "ArgumentError: Unknown key(s): group"
Here''s the full error: 1) Error: test_add_message_to_existing_ticket(TicketTest): ArgumentError: Unknown key(s): group /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.4/lib/active_support/core_ext/hash/keys.rb:48:in `assert_valid_keys'' /usr/lib/ruby/gems/1.8/gems/acts_as_paranoid-0.2/lib/acts_as_paranoid.rb:125:in `validate_find_options''
2009 Oct 27
5
Re-tasking destroy contoller action...is this bad practice?
I''m trying to get some opinions on a design I''m floating ("rails way" or not?). Say I''ve got an Author model in my Blog application and I want my administrators to be able to disable authors. I don''t want to delete authors because this would cause data integrity issues (orphaned Author foreign key in the Post model). So my plan is to re- task the
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
2009 Mar 06
5
ActionMailer Layout on HTML version not Plain Text
I''m sending plain text and html emails by having multiple files for each email I send. For example, for my registration email I have a registration.text.plain.erb file and a registration.text.html.erb file. I want to use a layout for the html version of my emails. In my mailer I put: class AccountsMailer < ActionMailer::Base layout ''email'' ... end
2006 May 20
1
acts_as_paranoid overrides ActiveRecord::Base??
Guys, I am trying to figure out what exactly does this line do at the end of "acts_as_paranoid" plugin? ActiveRecord::Base.send :include, Caboose::Acts::Paranoid::ActiveRecord My problem: I have some classes that I use acts_as_paranoid, and others with tagging support. Classes declared as taggable, throw error, which appears to be in the acts_as_paranoid version of the
2009 Mar 26
1
Turning off the layout in ActionMailer?
So I''m happy to see that ActionMailer supports layouts now (it may have for a while, but I just now realized it). But I don''t see a way to turn them off selectively or by multipart type. For example, if I have a layout that''s really simple in "layouts/ email.html.erb": <div style="border:1px solid gray"> <%= yield %> </div> I
2006 May 18
5
Overriding default DELETE behavior with logical deletes
Hello! I am trying to figure out how to implement *logical deletes* instead of physical deletes using ActiveRecord. Basically, in many applications that deal with E-Commerce, you really can''t physically delete almost anything, because records must be kept for auditing and customer service tracking purposes. In the past, I''ve implemented logical deletes as follows: 1.
2006 Mar 22
15
Rails-1.1.0-RC1 tagged today (4010)
Looks like Rails 1.1.0 RC1 is finally here: http://dev.rubyonrails.org/changeset/4010 -- Posted via http://www.ruby-forum.com/.
2009 Mar 27
3
ANNOUNCE: Hirb - A gem enhancing your script/console
Hi, I''m announcing Hirb, a mini view framework which enables script/ console to provide custom views. Out of the box your activerecord objects come back as ascii tables. You can also configure your tree-based models to return as ascii trees: Numeric |-- Float |-- Integer | |-- Bignum | `-- Fixnum |-- Date::Infinity `-- Rational I''ve written two tutorials on
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
2008 Apr 03
3
Overloading and wrapping an association method
Hi all: For example I have: class Color < ActiveRecord::Base belongs_to :ball end class Ball < ActiveRecord::Base has_many :colors end What I want to do is to write a method that: 1. takes the result of Ball#colors, which is an array of Color objects 2. do something with the array 3. return the result but I want to name my method Ball#colors, i.e. I want to overload the generated
2008 Apr 17
4
acts_as_paranoid is making me crazy
Acts_as_paranoid is giving me a headache when performing migrations. For some reason when I perform a migration I get a "stack level too deep" error. If I comment out the database inserts that are performed (countries, regions, and a base admin) it works well. Even after minimizing the data that is inserted on the migration to one record it still throws the same error. When running
2006 Jan 11
4
Code Shopping in Rails
Back in the horse-and-buggy days when I was cutting my OO eye teeth on Smalltalk, we had a LOT of conversations about the biggest problem dealing with a large and growing set of classes and methods in the Smalltalk image. It became clear that most, if not all, successful Smalltalk coders spent a lot of their time code-shopping, i.e., looking for a class or method that did something they
2008 Apr 11
2
Validating an ActiveRecord object and its has_many :through associations
Considering an object with several has_many :through => associations, what is the ''best'' way to handle validations? As an example: class Student < ActiveRecord::Base # some attrbutes like # :name # :grade # relationships has_many :students_assignment, :dependent => :destroy has_many :assignments, :through => :students_assignment has_many