similar to: Loading records during class definition

Displaying 20 results from an estimated 4000 matches similar to: "Loading records during class definition"

2006 Mar 19
3
Can''t add data during migration if column is called "type"
Hi I''m new to Rails. This is my first application and I''m trying to set up a schema I''ve hand-crafted as a migration. Does anybody know why this... # deposit_types create_table :deposit_types do |table| table.column :type_code, :string, :limit => 20, :null => false table.column :description, :string, :limit => 50, :null => false
2006 Apr 22
6
STI and type tables?
So by default to get STI, I would have something like: create_table :items do |t| t.column "type", :string t.column "title", :string end But if I want to store those type values in a separate table, such that I have ... create_table :items do |t| t.column "item_type_id", :string t.column "title", :string
2006 Apr 05
0
Is this model ordering logical or crazy?
Bit of a mind-bender here... I''m got a model that tracks rules that are applied to different levels of product data, including: Make, Product Range, Model, Derivative. There''s a RuleLevel class to represent each level and has a column position. It looks something like this: class RuleLevel < ActiveRecord::Base include Comparable def +(offset)
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 01
0
rake: uninitialized const ActionController::TestUploadedFile
Hi, My app uses attachment_fu and I''d like to pre-load some data via a rake task. Thus: [code]desc "Upload template files" task :upload_files_test => :environment do |t| conf = Conference.find(1) [{:f => ''styles.css'', :type_code => ''css'', :content_type => ''text/css''}].each do |i| file =
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
2006 Apr 21
28
Ruby, Rails & Linux - Which distro ??
Hi, I''ve been doing most of my initial playing with rails on a windows system - but wish to switch to a dedicated linux box for this. Are there any particular distro''s to avoid / recommend. I prefer debian for my other stuff, but thought i''d ask before going ahead. :) Cheers -- Posted via http://www.ruby-forum.com/.
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 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
2009 Oct 20
8
Stub that returns hash values
Is it possible to create a stub that returns hash values. For example I would like to convert this: @siteItem = stub(''plmSiteItem'', :one => "uno") To something like this: @siteItem = stub(''plmSiteItem'', {''one'' => ''uno'', ''two'' => ''dos''} ) So that I can do this: