search for: validat

Displaying 20 results from an estimated 26 matches for "validat".

Did you mean: validate
2006 Jun 20
2
Problem with "can''t dump anonymous class Class"
...very'' C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb :918:in `find_initial'' C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb :380:in `find'' C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/validat ions.rb:528:in `validates_uniqueness_of'' C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/validat ions.rb:302:in `validates_each'' C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/validat ions.rb:299:in `validates_each'' C:/Ruby...
2006 Nov 23
1
loess lines in xyplot with two or more variables on the left side of a formula
Hello: I recall something like this being discuss recently, but I can't seem to locate an example in the archives. I have data like the following: df <- expand.grid(1:4, 1992:2002) names(df) <- c("MSA", "YEAR") df$IDUPREV <- runif(44) df$VALIDAT <- rnorm(44) I want to create an xyplot() with separate loess lines for each series (IDUPREV and VALIDAT) in the same panel. I'm able to plot each series in the same panel like this: library(lattice) xyplot(IDUPREV + VALIDAT ~ YEAR | MSA, data = df, panel = panel.superpose, type...
2006 Jul 25
0
Some specs
...The specifications should be self-explanatory. I''m wondering if anyone can see anything obviously bad/wrong with what I have? I''m intentionally not stating anything else as in theory the specs should speak for themselves. Thanks in advance, Chris ---- specifications ---- A validatable object with no validators - should be valid - should have no error messages A validatable object with an always valid validator - should be valid - should have no error message A validatable object with an always invalid validator - should be invalid - should have the standard error message...
2006 Apr 29
1
can i alter the _form.rhtml without have troubles to validat
hello my name is reynaldo and i have a problem i alter the _form.rhtml to display a select option in the place a simple text_box, and the application work very well, but in the moment that i apply a validation in the model i get a error. the code is the next in the controller: def new @catelemento = Catelemento.new @komandancias = Catcomandancia.find(:all) end in the _form.rhtml <%= error_messages_for ''catelemento'' %> <!--[form:catelemento]--> <p&g...
2006 Jun 19
3
can''t dump anonymous class Class
...ndex "." self.name.gsub(/[^\w\.\_]/, ''_'') + file_name[idx, file_name.length - idx] end def sanitize_filename(file_name) File.expand_path("#{RAILS_ROOT}/public/documents/#{new_filename(file_name)}") end end class GlobalDocument < Document validates_uniqueness_of :name, :scope => :type private def sanitize_filename(file_name) File.expand_path("#{RAILS_ROOT}/public/documents/global/#{new_filename(file_name)}") end end ** Controller ** def documents @associations = Association.find(:all, :order => [ "na...
2009 Jan 23
1
Validation levels
Sometimes I want to show just one error, even when a field fails two or three validations. A custom validation method is easy enough, but the helpers are nice and concise. So, has anyone found a way of doing this with AR''s validation helpers? The :if/:unless look promising, but its made harder by validations being applied in a random order. - Andy P.s. The validatable ge...
2011 Mar 16
19
Uninitialized constant Files::Magick -still around
Hi there, I''m solving the problem about the plugin Magick. In my app in Gemfile I''ve follwoing: require ''rubygems'' require ''mongo'' require ''RMagick'' include Magick and in a model Files: class Files def self.save(upload) ... img = Magick::Image.read(''public/data/nature6.jpg'').first end end
2006 Jul 24
6
Mocking causes empty specification blocks
I''ve found myself mocking out a published api in my set-up method. This has led to some contexts having a large set-up and empty specifications. As the mocks get auto-verified, the specification blocks have nothing to do but serve as documentation. Does this sound bad? Chris
2007 May 05
10
have_one and have_present
...e, ''have_present'' doesn''t really tell me what is interesting about having it present, or why it should be present. I think ''require_attribute'' would be nice (''require'' would be even better, but obviously that is a keyword). Or ''validate_presence_of'': an { @asset.should validate_presence_of(:something) } That''s a little more Rails-developer-friendly than customer-friendly, but it still ''speaks'' better than ''have_present'' for me. FYI - Jay Fields has a Validatable framework t...
2006 Jul 12
5
validates_peresence_of
Is there an expert validater that can point me in the right direction? I''ve looked for extended documentation on ''validates_presence_of'' but i can''t seem to find any. I''m trying to make sure that i don''t enter a nil object in my database, so i''ve added valida...
2007 Oct 23
1
Compute R2 and Q2 in PLS with pls.pcr package
...g the mvr function of the package pls.pcr to compute PLS resgression using a X matrix of gene expression variables and a Y matrix of medical varaibles. I would like to obtain the R2 (sum of squares captured by the model) and Q2 (proportion of total sum of squares captured in leave-one-out cross validation) of the model. I am not sure if there are specific slots in the output of the mvr function that give these parameters (RMS and R2 parameters are given for each variable of Y). I have tried to compute it myself from the ouput of mvr but I am not sure if the values of Ypred within the validat s...
2004 Aug 27
1
predict.mvr error message
...version of R, what version of pls.pcr, and on what OS? Have you checked whether your versions of software are up to date? I get: > n <- 1350 > p <- 180 > y <- rnorm(n) > x <- matrix(sample(0:1, n*p, replace=TRUE), n, p) > fit <- mvr(x, y, method="SIMPLS", validat="none", ncomp=2) > xt <- matrix(sample(0:1, 312*p, replace=TRUE), 312, p) > yt <- predict(fit, xt) Andy > From: Stewart T Chang > > Greetings, > > I've encountered an error message while using the pls.pcr package > that's left me scratching my he...
2011 Jun 11
1
Having a problem adding a foreign key
...ongs_to :user end USER MODEL class User < ActiveRecord::Base has_many :books # Include default devise modules. Others available are: # :token_authenticatable, :lockable, :timeoutable and :activatable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable # Setup accessible (or protected) attributes for your model attr_accessible :email, :password, :password_confirmation,:firstname,:lastname,:school,:major,:sex,:zipcode end ROUTE Campus::Application.routes.draw do get "book/index" get "book/edit" get &quot...
2005 Dec 16
4
Validation with Aggregation
ActiveRecord supports composed_of for value objects which is fantastic but one thing that it doesn''t seem to support (or at least I am unable to find any documentation for) validation of the value objects. For example, given the following: class Message < ActiveRecord::Base composed_of :sender, :class_name => ''EmailAddress'' composed_of :recipient, :class_name => ''EmailAddress'' ... end class EmailAddress attr_reader :name,...
2009 Jul 04
9
prevent orphan records
If I have belongs_to :user Do I need to have validates_presence_of :user_id ? Does Rails validate the presence of :user_id automatically if I have belongs_to :user? In other words, does Rails prevent against creating orphan records that belong to non-existent users? Thanks. -- Posted via http://www.ruby-forum.com/.
2011 Jun 13
0
Devise Authorization Error
...rsController devise_for :users, :path_names => {:sign_in => ''login'', :sign_out => ''logout''} --- END routes.rb --- --- admin.rb (Model) --- class Admin < ActiveRecord::Base devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable attr_accessible :email, :password, :password_confirmation, :first_name, :last_name, :superadmin end --- END admin.rb --- --- new.html.erb (The login form) --- <div class="login_container"> <div class="title_container">Administrator Login</div> <div...
2012 Feb 04
0
ActiveRecord Associations not working in RSpec with Devise
Hi everyone, I have the following classes: class User < ActiveRecord::Base devise :database_authenticatable, :registerable, :timeoutable, :recoverable, :rememberable, :trackable, :validatable has_many :comments, :dependent => destroy ... end class Comment < ActiveRecord::Base belongs_to :user belongs_to :commentable, :polymorphic => true ... end In rails console, I can successfully create a new comment via user: > @attr = { :title => "Something", :...
2012 Dec 11
0
upgrade problems and questions
...he "first" problem: Based on the activemerchant documentation, the 2.3.4 plugin should be replaced by a gem. I removed the plugin and added the gem to the Gemfile. Bundler runs clean. But when I then try rake rails:upgrade:check again, I get uninitialized constant ActiveMerchant::Validateable::HashWithIndifferentAccess -- 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...
2013 Mar 07
0
custom table_name for table users with devise
...ser < ActiveRecord::Base rolify # Include default devise modules. Others available are: # :token_authenticatable, :confirmable, # :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, #:confirmable, :recoverable, :rememberable, :trackable, :validatable def self.table_name debugger ''franceusers'' end def self.table_name_prefix debugger ''france'' end thanks to debugger, I can see that is called but not self.table_name_prefix. And even if self.table_name if called, devise search user...
2006 Sep 20
3
Unit and Functional Tests Bombing with Ferret
Hello, I am currently using ferret 0.9.5 and acts_as_ferret 0.2.3 on windows XP All my unit and functions test that used to work before I installed ferret are erroring out. My index is on a model name Post, and it looks like all tests that contains methods which does CRUD to the Post model bombs out. Is there anything special I need to do before running unit and functional test? Thanks