similar to: Granular model validation based around controller actions?

Displaying 20 results from an estimated 5000 matches similar to: "Granular model validation based around controller actions?"

2006 Mar 17
5
Radio Button Validation
I''m writing a quiz application and I need to validate the radio button reponses. I do not have the questions in a database, I just have forms which contain "question1" and then I strip out the "question" portion and just insert the number as the question''s id. So now I''m faced with the dilemma of making sure the radio buttons are pressed. Radio
2006 Aug 08
3
Database transactions
Hello, I have an application where I need to create two records in a database transaction. ie: begin User.transaction(user) do User_details.transaction(user_details) do user.save user_details.save end end end rescue flash[:notice] "Insert rolled back... but why..??" end >From reading the Agile book, I gather that once I wrap the
2006 Feb 27
1
Functional test problem with environments variables
Hi guys, i have been experiencing this problem once i put in some constant declarations in /config/environments/development.rb. I declared it very normally like this : USER_DETAILS = { :name => ''abc'', :password => ''123''} it works in the controller and when i run the application, i managed to get the values out from the development.rb by using some
2005 May 08
3
sqlite, views, incorrect data types?
This has been driving me crazy for a few days now. I am using sqlite3 however I have also found this to be the case with 2.8.15: I have data types text or integer on every column of every table in the database. Now i know sqlite doesnt care much about data types, but I believe rails does (correct me if im wrong). On pages that query a table, everything is perfect. BUT when I use a view
2006 Jan 11
7
Create a relationship with 2 or more tables on 1 insert
userstable: |id|name|password| userdetailstable: |id|col1|col2|col3|user_id| this is my code: [code] def create @user = User.new(@params[''user'']) @userdetail = Userdetail.new(@params[''userdetail'']) if @user.save and @userdetail.save flash[:notice] = "Save succeeded..." redirect_to :action => ''list''
2010 Feb 17
3
2nd REPOST: mbox vs maildir
I'm going to assume this is just not possible, or that no one has an answer, which would lead me back to uw-imap since it does work as-is. So I'll post it again, hoping that there is a solution for this setup and that folks have just been too busy to help think about it and/or help come up with a possible solution. ----- Ignoring my previous message just for a second, I realized
2007 Jul 11
21
"they" synonym for "it"?
I''ve noticed that I phrase a lot of shared behaviours in plural, eg describe "All payment_details views" How about a "they" alias to "it" so you can write describe "All payment_details views", :shared => true do they "should have a card number field" do # ... end end WDYT? Ashley
2006 Apr 01
7
BigDecimal column type?
I was hoping 1.1 would provide a way to map SQL "decimal" column types to BigDecimal values, since BigDecimal is part of the Ruby standard api as of 1.8. But I don''t see any support for that in the migration documentation, and when I try to let Active Record do the mapping for me, it seems to coerce the column into a Float (as the AwdwR book says). Is it really there in
2008 Mar 17
8
should have_tag outside Rails
Hi Google has not helped me here. I''m looking for a way to use the have_tag assert_select wrapper outside RSpec on Rails (but in a Rails project) so I can use it to check text strings. Has anyone managed this? Thanks Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL:
2015 Feb 26
2
Kickstart with multiple eth devices
On Thu, 26 Feb 2015 13:42:57 -0600, Ashley M. Kirchner <ashley at pcraft.com> wrote: > And after picking this back up this morning .... still no dice. I have > now > blacklisted the one module that would enumerate the add-in ethernet port > so > that is no longer an issue during the kickstart process, however the > following is now happening: > > - kickstart
2008 Apr 29
5
Sharing: dont_repeat_yourself plugin custom RSpec matcher
I wrote a Rails plugin which uses simian to look for duplicates lines in your code and reports in html format, Textmate or Netbeans. I wrote it using RSpec and I have included a RSpec custom matcher: it { rails_application. with_threshold_of_duplicate_lines(4). should be_DRY } If you use Autotest, your specs will fail the next time you do a nasty copy-paste !!! More details in
2015 Feb 25
4
Kickstart with multiple eth devices
On Wed, 25 Feb 2015 17:11:02 -0600, Ashley M. Kirchner <ashley at pcraft.com> wrote: > Add "rdblacklist=MODULE_NAME" to your append line in pxelinux.conf file. >> > > Trying that next. It'll have to wait till tomorrow as we're under a > serious > blizzard/snow event right now and I'd like to get home before all of hell > freezes over.
2008 Jul 11
2
plotting granular data
Hello R users, I would apprecaite any help to my current problem. I wanted to plot the following data: 3.3705997271301E-06 -0.000193767858719911 -4.30103236602221E-05 -1.22606947412076E-06 -2.14297322582901E-05 -5.66282817417529E-05 -2.56009760591276E-05 -2.39301719384927E-06 -0.000134400221353397 9.92533531897553E-07 -8.71761124710774E-05 -6.22061231022366E-06 -0.000122373909510313
2008 Dec 02
11
Any plans for Before-feature or Before-all steps in Cucumber?
Hi The code I''m working on now is a server daemon that talks to Twitter, an RSS feed, and some web pages. I''ve got mock implementations of Twitter and the web stuff, which I start and stop with daemon_controller[1]. I do all the setup in a Before block, but this makes the feature runs agonisingly slow due to the time waiting for everything to restart. I''m
2007 Aug 08
9
RSpec book?
<http://www.apress.com/book/bookDisplay.html?bID=10368> Came across this as a stub page browsing Amazon UK. This is good news! I''m surprised it hasn''t been discussed on the list before. Was Chad keeping it a secret? I hope it will have plenty of BDD theory. I''m still waiting for that magic book I can give to someone and say "here - read this, it
2007 Feb 12
6
Specs for Ajax partials with unicode characters
Hi Not sure if this is more Rails or RSpec related... I''ve got an app with an RJS view that updates a div in a page with the contents of a partial. The partial contains a non-ascii character namely a pound sign. I set up a simple test app with this RJS view: page.replace_html("test_div", :partial => "test_action") and this _test_action.rhtml:
2007 Oct 31
16
Am I missing something with Heckle?
Hi I can''t get heckle working. In fact, I''ve built an example so simple that it either shows a bug, or I am being really, REALLY stupid. Heckle does not appear to support RSpec directly, so I''m trying to use spec --heckle (RSpec trunk as of 10 mins ago, Heckle 1.4.1). I''ve constructed this pair of sample files: 18> ~/Desktop/heckle_test % cat
2008 Mar 13
22
Specifing methods in a steps_for block
Hey list, I''m refactoring some much-used functionality into a common_steps step group. Methods like this are in there: steps_for :common do Given "a number of existing $types?" do |type| @initial_item_count = type.singularize.classify.constantize.count end When "the user adds an invalid $type" do |type| post
2007 Sep 03
20
Reason for _spec.rb convention
Hi Easy one - I just wondered why all spec files for rspec_on_rails end "_spec.rb" instead of just ".rb"? They are all inside the spec folder so surely the fact they are specs is implicit? Ashley
2007 Jun 27
6
Aspects in RSpec 1.0.5
Forgot post this when I did it... For anyone else that used the "aspect" method of the rspec-ext gem, here''s a New World version of the code to drop into spec_helper.rb. (I''m assuming rspec-ext hasn''t been updated since I did this a week or two ago) module Spec module DSL module BehaviourEval module ModuleMethods def