similar to: offeride :limit named_scope default_scope

Displaying 20 results from an estimated 300 matches similar to: "offeride :limit named_scope default_scope"

2009 Jul 23
11
Problem with named_scope
Here are my scopes: default_scope :order => ''posted_on DESC'', :conditions => { :status => ''visible'' } named_scope :positive, :conditions => { :rating => ''positive'', :status => ''visible'' } named_scope :neutral, :conditions => { :rating => ''neutral'', :status =>
2009 Oct 17
2
Skip default_scope when running migrations
Hi, I was wondering if there is a way to skip the application of a named_scope to calls made in legacy migrations. I am working with some old migrations that include some data manipulation tasks, and my default scope is preventing those migrations from running. I''m trying to avoid editing those migration files with with_exclusive_scope. Thanks, -G -- Posted via
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
2011 Feb 02
6
how to set default_scope for the whole application?
I know I can set default_scope for individual active record model, but can I set one up for the whole application? thanks -- 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 this group, send email to
2009 May 12
4
different results on linux and windows
Dear R experts, we are preparing an R-package to compute the Oja Median which contains some C++ code in which random numbers are needed. To generate the random numbers we use the following Mersenne-Twister implementation: // MersenneTwister.h // Mersenne Twister random number generator -- a C++ class MTRand // Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus // Richard J.
2010 Sep 01
4
deprecation warning in Rails 3 about Base.named_scope
I recently upgraded to Rails 3, and this error has come up ubiquitously: DEPRECATION WARNING: Base.named_scope has been deprecated, please use Base.scope instead. Any ideas on how to get rid of it? Or should I just wait for something? There''s actually no place in my application where the code "Base.named_scope" exists, so I assume the problem is inherent in gems that
2011 Mar 24
1
high "init" load on ubuntu domu with centos dom0
I have an odd problem. I am running an ubuntu 10.04 domu that I got from stacklet on my centos 5.5/xen4.0.1 dom0. The problem is that even sitting idle the domu has a 1.05 load with init taking up 99% of that. I have searched around but have not found what is causing the issue. I thought I remembered this being mentioned on the list before but could not find it either. My domu.cfg is as
2008 May 13
6
Testing that named_scope is defined
Hi guys, I''m just beginning to use RSpec and I ran into the issue of testing a named_scope. I''m not actually trying to test its behavior, as it''s not my code, but I wanted to test at least that it''s defined. I tried doing this: describe Post, ".most_recent" do it "should be defined" do Post.method_defined?(:most_recent).should be_true
2010 Jan 05
2
Conditional named_scope chaining with params (Need help)
Hello there, I have a model that has more then one named_scope. In my action Index of the controller that handle this model I want to do this in a drier way: if params[:ownership] == "mine" @posts = Post.tagged_with(params[:tags], :on => :tags).owner(current_user.id).paginate :all, :page => params[:page], :order => ''created_at DESC'' else
2007 Feb 09
2
quota interferes with dovecot
hi guys, im having some trouble on my quota.whenever my client reaches the quota, they cant download their mails anymore. +OK Dovecot 1.0 ready. user test +OK pass testd -ERR [IN-USE] Couldn't sync mailbox. +OK Logged in. Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems, or a long period of inactivity. Account: ,
2018 Jan 03
2
sieve/internal error/detail subaddress and IMAP4FLAGS.
I'm trying to set an IMAP Flag with the detail part of an address, but getting an internal error: an 3 13:37:27 thebighonker exim[537]: 1eWoqt-00008f-4u <= ler at lerctr.org H=(lrosenman.local) [74.203.163.58]:4650 I=[192.147.25.65]:587 P=esmtpsa X=TLSv1.2:ECDHE-RSA-AES256-GCM-SHA3 84:256 CV=no SNI="smtp.lerctr.org" A=dovecot_login:ler S=769 id=20180103193716.oofszdaxopnkgfvd at
2011 Sep 29
3
For loop for subset - repeating same over and over?
Hello, I am using the following script to run an anova for numerous species in a table that I have: SiteSpp <-
2012 Jul 25
0
Rails3-default_scope throws exception: undefined method abstract_class? for Object:Class
I would like to apply logical delete in my application(Instead of permanently deleting a record just have been marked as deleted). I have Added *available* column to all tables with default value *true*. Now I want common place to write the following code for all models. 1. Write the instance method which make ''available'' column value false when user clicks on
2006 Mar 17
1
RSS problem when trying to display ID - HELP
I want to append "#comment-1" or whatever, depending on the id to the end of my xml.link(" ... /#comment-1") attribute in my generated xml. Well, when I put: xml.link(" ... /#comment-" + comment.id) I get an Application error (rails) message when I look at the generated XML. This is what I''m doing without the id on the comments (its working fine):
2006 Mar 04
1
Saving current date/time upon comment submission - help!
I''m having trouble storing the date/time with my comments - I''m getting the MySQL error "posted_at is null". How do I setup my code to automatically store the current date/time in the ''posted_at'' column of my ''comments'' table? -- Posted via http://www.ruby-forum.com/.
2008 Apr 04
0
named_scope and ordering
Hi, this is a general design question and I liked to see how other people handle the following situation: Before named_scope I wrote custom finders for my model classes. Something like # order.rb class Order < ActiveRecord::Base class << self def find_all_marked find(:all, :conditions => {:marked => 1}, :order => ''name ASC'') end end end Now
2008 Jun 12
0
named_scope doesn''t check for critical method names.
I just entered this ticket. http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/404-named_scope-bashes-critical-methods It turns out that in an ActiveRecord model like this Model << ActiveRecord::Base named_scope :public private def private_method end public def public_method end end The method public_method will be private because named scope
2010 Nov 03
0
Accessing (updating?) the proxy_scope chain for named_scope (Rails 2.3.x)
I have many named_scopes chained together in the normal way. So far so good. However in a couple of cases where: 1. The named scope is actually a correlated subquery and I need to pass additional scope into it sometimes. 2. Where the presence of a named scope in the chain should change the behaviour of a named_scope later in the chain Given: Product.price.volume.average_discount
2008 Jun 12
0
Mysterious interaction between RSpec 1.1.4 and has_finder/named_scope
I just opened a Rails ticket on a problem with named_scope in Rails 2.1, and cross-posted a message here which I send to rails-core. I''m still a bit mystified, because I''m having a problem caused by this on RSpec 1.1.4, but not on 1.1.3, and I don''t see a difference in code which would explain it. The basic problem, which I encountered upgrading our rails app to RSpec
2008 Jul 20
0
eager loading a named_scope
Hi, I''d like to eager load a named_scope like this: User.find(params[:id], :include => [:friends.married]) Any ideas? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To