search for: validatable

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

2006 Jun 20
2
Problem with "can''t dump anonymous class Class"
I submitted this earlier, but the web forums went down and I''ve screwed up the thread, so I''m starting over. I''m trying to built a document upload system. The system has a main Document model with different subclasses for different types of documents. With the code below, if I attempt to create a Document, it works fine, but if I attempt to use one of the subclasses, I
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
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 A va...
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
2006 Jun 19
3
can''t dump anonymous class Class
I''m trying to create a document upload system, where most of the code is the super class Document and just the path to file on the system is controlled by the sub classes. When I attempt to use my code, I get the following when I try to save the document. can''t dump anonymous class Class Any ideas? ** Migration ** class CreateDocuments < ActiveRecord::Migration def
2009 Jan 23
1
Validation levels
...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 gem has the excellent ''level'' option on it''s validation helpers. http://validatable.rubyforge.org/ "Validations can be given levels. If a validation fails on a level the validations for subsequent levels will not be executed." -- Posted via http://www.ruby-for...
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
...). 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 that includes some test/unit assertions that look like this: Foo.must_validate do presence_of :name format_of(:name).with(/^[A-Z]/) numericality_of(:age).only_integer(true) end Because Spec::Rails behaviours inherit from Test::Unit::TestCase, you can install the validations gem (g...
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 validate_presence_of to my Record Model. i.e. --> class Record <
2007 Oct 23
1
Compute R2 and Q2 in PLS with pls.pcr package
Dear list I am using 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
2004 Aug 27
1
predict.mvr error message
What 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,
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 "boo...
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,
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 cla...
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", :cont...
2012 Dec 11
0
upgrade problems and questions
I''m trying to use the rails_upgrade plugin to upgrade a 2.3.4 app to 3.2.9 and running into all kinds of things that "don''t work". I''ll start with a specific problem. Hopefully you folks can help me discover a "pattern" so I don''t need to post to this group for every problem. The "first" problem: Based on the activemerchant
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 users in...
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