similar to: Spec a before_destroy callback in Sequel

Displaying 20 results from an estimated 500 matches similar to: "Spec a before_destroy callback in Sequel"

2008 Jul 02
2
How to write the method before_destroy and the test
How to write the method before_destroy? Here is my code: def before_destroy errors.add(:isdefault,"Can''t destroy default record") if self.isdefault return false end or I should write it like below? def before_destroy raise(Can''t destroy default record") if self.isdefault end and how to write the test for it -- Posted via
2007 Nov 07
1
merb/sequel mutex on or off? proxy_balancer or no?
Just a quick question to those of you using merb and sequel or datamapper. How do you setup your merb app? For example: merb -X off -c 5, then run mod_proxy_balancer or nginx to load balance between the 5 (or whatever #) of merb nodes? merb -X off -d, then simply use something like proxypass merb -c 5, keep the mutex lock and cluster it haproxy, swiftiply, evented mongrel...... What
2006 Mar 24
2
before_destroy not called
Hello, I''m trying to intercept delete call in my model but before_destroy callback is never called... Somebody knows why ? Thanks The controller : def delete Image.delete(params[:id]) redirect_to :action => "list" end The model : class Image < ActiveRecord::Base set_table_name "publish_images" belongs_to :article before_destroy :on_destroy
2011 May 11
0
sequel
anyone using sequel with rails? any references regarding comparing sequel with other solutions(vs ActiveRecord, vs DataMapper and so on)? thanks in advance. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from
2007 Mar 14
0
before_destroy return false, but dependent are destroyed
I have a problem with before_destroy deleting by dependent records, even through I return flase. ... has_many :users, :class_name => ''Editor'', :as => :editable, :dependent => :destroy ... def before_destroy unless self.has_access?(99) errors.add_to_base "Destroy permissions error!" return false end end When I remove the dependent
2007 Oct 23
2
sample app using Sequel?
I''m a new merb user. Rather than ask a bunch of questions on this list, I''d like to ask if anyone can point me to a sample merb application preferably using trunk (or close to it) and preferably using Sequel for the ORM. If I can''t figure out how to bull my way through things from a sample, I''ll come back and ask my newbie questions. Thanks! cr
2005 Jul 24
0
cancelling before_destroy
According to the documentation, if I return false in a model''s before_destroy method then it should cancel the action. Although I know it is reaching and running this code, it deletes the object despite the "return false". I''m sure this were a bug it would have been noticed by now so I must be missing something but I cannot imagine what. Even in the simplest
2006 Nov 17
4
before_destroy and sessions
(Semi-newbie.) I want to ensure a user''s able to destroy only his own objects. I''ve set session info at login: session[:user_id] = user.id Now I try this in the model of my deletable objects: before_destroy :destroy_your_own def destroy_your_own raise "Can''t delete that!" unless session[:user_id] == self.user.id end which snags EVERY attempted
2011 Apr 04
1
RGtk2: How to populate an GtkListStore data model?
hello all I am trying to learn how to use the RGtk2 package... so, my first problem is: I don't get the right way for populate my gtkListStore object! any help is welcome... because I am trying several day to mount the code... Thanks in advanced Cleber N. Borges --------------------------- # my testing code library(RGtk2) win <- gtkWindowNew() datamodel <-
2006 Jun 29
1
before_destroy & verification
Hey, probably an easy question but, I''m trying to get a method to run "before_destory" for a model, and I want the method to throw an error, and not delete the object from the database, if a certain condition is held Obviously, I can just raise an error and rescue it... but for some reason I can''t get <% error_messages_for ''model" %> to catch
2012 Oct 18
3
Issues upgrading RSpec
My specs work fine with this in my Gemfile.lock: grep rspec Gemfile.lock rspec (2.11.0) rspec-core (~> 2.11.0) rspec-expectations (~> 2.11.0) rspec-mocks (~> 2.11.0) rspec-core (2.11.0) rspec-expectations (2.11.1) rspec-mocks (2.11.1) rspec-rails (2.11.0) rspec (~> 2.11.0) rspec-rails (~> 2.11) After "bundle update
2012 Apr 27
3
rails console --sandbox is only half-baked
Recently I''ve found out some mentions to the "--sandbox" parameter to the "rails console" command. And I found the idea interesting, but since I''m using Sequel instead of ActiveRecord I guessed this wouldn''t work for me. But after talking about this subject in the Sequel mailing list, Jeremy Evans has brought to my attention that there are some
2004 Feb 16
0
error in nls, step factor reduced below minFactor
Hello, I am trying to estimate 4 parameters of a non-linear model using nls. My model function is a Fourier integral and is very expensive to calculate. I get the following error: > theta0 <- c(0.045, 1.02*10^(-4), 0.00169, 5.67*10^(-4)) > res <- nls(log(y) ~ log(model(theta,r,t)), data=dataModel, + start=list(theta=theta0), trace=TRUE, + control=nls.control(tol=1e-2))
2008 Mar 24
0
[PATCH] trivial build cleanup
xenapi.out needs to be ignored and removed on clean; tools/ioemu/i386-dm/Makefile is a soft link and should be ignored. Signed-off-by: Alex Williamson <alex.williamson@hp.com> -- diff -r dba5f548b894 .hgignore --- a/.hgignore Mon Mar 24 14:25:52 2008 -0600 +++ b/.hgignore Mon Mar 24 16:27:21 2008 -0600 @@ -58,6 +58,7 @@ ^docs/user/user\.html$ ^docs/xen-api/vm_lifecycle.eps$
2020 Feb 20
3
SQL modeling tool for CentOS 7
On 02/16/2020 10:47 PM, Bee.Lists wrote: > Sequel ORM > > >> On Feb 16, 2020, at 7:28 PM, H <agents at meddatainc.com> wrote: >> >> I am looking for an open-source SQL modeling tool to use with MySQL, MariaDB and PostgreSQL. Does anyone have a favorite? > > > Cheers, Bee > > > > > _______________________________________________ > CentOS
2007 Sep 26
0
Fwd: error with schema_info when doing multiple migrations
Posting to merb list in case it is a merb problem. (?!??) The error still happens with sequel 0.2.1. ---------- Forwarded message ---------- From: Kevin Williams <kevwil at gmail.com> Date: Sep 23, 2007 10:26 AM Subject: error with schema_info when doing multiple migrations To: sequel-talk at googlegroups.com I tried to post an issue to the project site but it kept giving me 500 server
2007 Jun 29
1
Speeding up :dependent => :destroy
I have a tree of models that represent a book. Looks like this: book sections documents paragraphs index entries glossary entries footnotes index entries glossary entries These are all models with has_many from parent and the child has belongs_to. They also all have dependent => :destroy
2020 Feb 23
1
SQL modeling tool for CentOS 7
On 02/20/2020 05:18 PM, Liam O'Toole wrote: > On Thu, 20 Feb, 2020 at 16:36:51 -0500, H wrote: >> On 02/16/2020 10:47 PM, Bee.Lists wrote: >>> Sequel ORM >>> >>> >>>> On Feb 16, 2020, at 7:28 PM, H <agents at meddatainc.com> wrote: >>>> >>>> I am looking for an open-source SQL modeling tool to use with MySQL, MariaDB
2007 Sep 22
3
merb_sequel raketasks not working?
I''m trying to run on trunk. When I run "rake -T" I get an error: undefined local variable or method `full_config'' for Merb::Orms::Sequel:Module I''m not 100% sure that I haven''t messed something up, so I hesitate to cry "bug" without checking with everyone. Is anyone else seeing this? P.S. I''m running merb trunk installed as a gem,
2007 Mar 06
0
:dependent => :destroy_unconditionally?
Hey... I have these business_accounts that have a bunch of members through a business_account_membership model. A membership can be a privileged, "managing" one, and a business account should always have one such privileged member, so I have a before_destroy filter on the business_account_membership model to prevent the deletion of the last managing member of a business account.