search for: some_field

Displaying 8 results from an estimated 8 matches for "some_field".

2011 Apr 18
1
has a field through an association
Hey guys, Trying to figure out how to do something like the following: class Child belongs_to :parent has_field :some_field, :through => :parent end class Parent has_one :child attr_accessible :some_field end child.some_field #=> parent.some_field child.some_field = value #=> sets parent.some_field = value I can of course accomplish this by adding custom accessors to Child, but looking for a bette...
2011 Feb 27
1
Database abstraction
..., using R objects to represent elements of a database system (statements, clauses, operators, functions, fields, tables, etc.). R5 classes have made the development of this package somewhat easier than it would have been in the past (in my view, at least). Then an expression like: query(some_table$some_field)$where(some_table$some_field != NA & some_table$some_other_field %in% c(1, 2, 3)) would generate SQL like: SELECT `database`.`some_table`.`some_field` AS `some_field` WHERE `database`.`some_table`.`some_field` IS NOT NULL AND `database`.`some_table`.`some_other_field` IN (1, 2, 3); The basic f...
2008 Apr 02
9
Problem getting the most recent has_many associated object
I can''t get my view to display the most recent parameters from an associated object in a view... here is a birds-eye of my app: I have two models, Ferms and Kinetics. Ferm has_many :kinetics, Kinetic belongs_to :ferm. Kinetic has the fields ferm_id, brix and temp. In my ferms/index view I have a table listing the attributes of each ferm instance. I would like to display the most recent
2008 Aug 27
5
VALIDATION QUESTION
I''m trying to validate a record before save. I''m using one controller in this case furnii where I have all my calls. The problem is that, the form containing the field I''m trying to validate resides in the furnii views. I tried to add validates_presence_of :content (the field name) in both the furnii model and the ratecomment model but it does not work. I know there
2011 Aug 03
1
Gem and/or meta_where problem
I''ve installed the gem "meta_where" (and it reported back: "Succeeded") but when I use the example in a search method of a controller: Person.where(:some_field.matches => ''%something%'') there is an error that it doesn''t know the method ''matches'', so what still needs to be done to properly activate the gem and make its methods available? Thanks, Barney -- You received this message because you are subscrib...
2007 Mar 13
13
validates_inclusion_of disabling
...me validations during a migration period, is there a way? I tried to use if, with a static method of one of my models, but the behaviour is something strange It seems that the static method should be in a string to be evaluated. And the order of the elements in the if is counting... :if => (:some_field && ''MyModel.some_static_stuff'' ) -- 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 Aug 15
2
Unit Testing Problem
I''m having a bit of difficulty when testing my models, I''ve read a few times the testing chapter in Agile web development with rails and at http://manuals.rubyonrails.com/read/chapter/27 but i''m still unsure of what I should be testing. Firstly I''d like to be able to test things like my email validation using lines such as assert User.new(:email =>
2006 Apr 26
5
Best way to split forms into steps?
I have a form with about 30+ fields, which the client is wanting to separate into 3 pages/steps - just wondering what is the best way to go about this, specifically remembering data entered, from one page to another, and making sure the various bits of data are validated correclty, error messages outputted etc etc... is there a best practice method for doing this? -- Posted via