Displaying 20 results from an estimated 2000 matches similar to: "Program logic behind Ruby On Rails"
2006 Jun 05
2
Class Table Inheritance implementation
I know that Rails uses the Single-Table Inheritance as mentioned in the
wiki (http://wiki.rubyonrails.com/rails/pages/SingleTableInheritance). I
was wondering if there was an easy way of implementing Class Table
Inheritance easily (one table per class) as defined in
http://www.martinfowler.com/eaaCatalog/classTableInheritance.html.
The model that I am used to is Class Table Inheritance, and
2006 Jan 18
3
Support for foreign keys in Migrations
Is there any work being done to add support for defining foreign keys in
ActiveRecord Migrations? If not is it something that people would find
useful or do most people here believe in the "Application Database" style
over the "Integration Database" style [1] as defined by Fowler?
I''d love to see support for foreign keys in Migrations. For selfish reasons
2007 Feb 05
10
how does Mocha compare in terms of classical vs mock-based testing, and stubbing???
Hi guys,
I''ve just been reading Martin Fowler''s article re mock versus
stubbing<http://martinfowler.com/articles/mocksArentStubs.html>where
he compares traditional TDD testing techniques with mock based
testing. I''d be interested in comments from a ruby on rails perspective in
terms of this and Mocha? For example:
a) Do you see Mocha as a robust way to test Ruby
2006 Mar 14
4
Two Customer Types - Best Design Principle?
Hi all,
I''ll do my best to explain this... I have the possibility to have two
customer types in my system:
1. A "mailing list" type: new records are saved when user enters email
address in the mailing list subscription form.
2. A "full" type: new records are saved when the user buys something and
provides all their billing/shipping details, etc.
Model:
-
2008 Jan 01
26
Did DHH have a suit on?
So I''m wondering about the origin of "ActiveRecord" and "ActionPack" and
the like in Rails.
I''ve always thought that perhaps DHH found himself in a suit one day
(maybe he had to attend a friend''s wedding or something), and as long as
he had the suit on, decided to lapse into a one of the barely lucid
frenzies that Marketing people are prone to when
2008 May 18
2
Using Hash to mock classes that respond to :
Hi
I''ve been doing this a while now. If I have a class that responds to :
[], and all I''m interested in stubbing is that method, then instead of
using a mock I just create a hash. (Similarly, you could create an
array when you are testing an Enumerable object.)
Example from code I just worked on, where uses MigrationGraph#[] looks
up graph vertices by name:
2006 Jan 02
11
aligning Ferret''s IndexSearcher.search API with Lucene''s
Recently I''ve been revisiting some of my search code. With a greater
understanding of how Java Lucene implements its search methods, I
realized that one level of abstraction is not present in the Ferret
classes/methods. Here are the relevant method signatures:
Ferret''s search methods:
in Ferret::Index::Index:
search(query, options = {}) -> returns a TopDocs
2005 Jun 27
9
FK constraints overrated?
Hello folks,
I use to think that a relational databases without foreign keys
constraints enforced strictly by the RDBMS were no good, piece of crap,
data junk.
However, I''ve also learned the hard way that FKs constraints imposes
serious difficulties when moving data around, specially between
different DBs, or for loading test data or for upgrading DBs schemas, or
for porting DBs
2006 Feb 02
6
How do I? Same Model, Different Controllers, Different Validations?
Hi all --
The simple question is: How do I set different validations for the same
Model, when accessed in different Controllers?
Here''s the scenario: I have a store/cart app, with a customer-facing
shopping cart, and a typical Admin side. The Admin side also has an
Order Entry component, where our staff can enter orders received by fax,
telephone, etc. Both the customer-facing cart
2006 Jun 21
12
Question{maybe silly] Sanity check
This maybe a silly question and the fact that I need a sanity check
might even be weirder, but I''m trying to set realistic expectations
for myself.
I''ve been reading reading reading AWDWR, Ruby on Rails, some of the
PickAxe, and even done a few recipes from Rails Recipes. This is all
of two weeks. I feel that I''ve learned a considerable amount but
going through the
2007 Feb 06
3
Using any_instance with Rails to make sure the right thing is saved?
I''d like to test that an object with the correct attributes is saved,
something like:
def test_create_without_existing_suite
this = self
w = Annotation.any_instance.expects(:save).with do |x|
this.assert_equal ''fnord'',
some_way_get_the_name_of_the_receiver_of_save
true
end
w.returns true
end
But the object is created inside the method
2008 May 10
4
Newbie: lambda do...end.should change(Model, :count).by(1). Doesn''t work
Hi to everyone,
I''m an RSpec, and BDD in general, newbie so in order to learn I have
chosen to use my personal website as a tesbed.
I''m having difficulties juggling with mocks, and in particula with the
following code.
Here''s the controller action:
def create
@album = Album.new(params[:album])
if @album.save
flash[:notice] = "album saved"
2006 Jan 17
30
MVC design good/bad
I am curious what you find is good and bad MVC design.
Let''s use the find and find_by_sql methods as examples.
Currently I have these spread out all over the place...
View: here I have some find methods when I am for example populating a
select list with choices in a form.
Controller: here I have the simpler find methods.
Model: here I have the more complicated find methods (usually
2007 May 24
9
Mocking, changing method interfaces and integration tests
Suppose we have a method ''foo'' which internally uses another method
''bar''.
Being good BDDers we mock out the ''bar'' method. After all, we only
want to spec the ''foo'' method - actually running the ''bar'' method
means slower, less maintainable and brittler specs. That''s why we <3
mocking,
2007 Jan 11
4
counter-intuitive behaveour when passing a proc to Mocha::Expectation#returns
Let''s say that I have a procedure that:
* gets the number of bytes to write into some file
* and returns the number of successfully written bytes
def save( text, len )
This procedure is being used all over the place especially inside the method
"process" which I want to test. Thus in order not to polute my filesystem I stub
the "save" procedure. But of course in
2006 Aug 13
10
does rails enforce referential integrity???
Hi,
Is rails supposed to support referential integrity? That is rails
either support to be able to ensure that when a new contact is created
this can only happen if a valid suberb is associated with it, and which
mechanisms of the below are supposed to do this?
(a) using DB foreign key constraints information as a basis?
(b) using the "has_one" line in the model file to enfore?
If
2008 May 20
4
New to "Agile Development" - should I use RSpec or Test::Unit?
Hi everyone, I''m just now really starting to look into Agile
Development, and so I''m trying to gauge what the Rails community''s
preference is in regards to using RSpec versus the built-in Test::Unit.
I haven''t really delved much into testing in the past, I''m sad to say,
but I understand why it''s beneficial to writing maintainable code and
2006 Feb 20
5
find(:all) vs find_all
I started with Ruby on Rails in the 0.13.x period, so I''m sure I
missed out on a lot of history. There''s probably some good
explanation for something I''ve been wondering about, but I haven''t
seen it written down anywhere. Maybe someone can clue me in.
I''ve always felt that one of the uglier APIs was the
ActiveRecord::find() method. I call
2009 Feb 27
1
what is the effect of high LBO settings?
I'm working on an Asterisk system with all of it's PRI ports configured with
the LBO setting at 5, like this:
span=3,0,5,esf,b8zs
As of yet, I am unwilling to change the LBO to 0 to where it probably should
be because the system is working and I'm not sure exactly what the LBO does.
I'm aware some changes were made to deal with low audio levels. Does anybody
know what audio
2019 Dec 09
4
[EXTERNAL] Re: Tripp Lite SMART1500LCD repeatedly disconnecting and reconnecting
I haven't tried it on RaspberryPi, but if there's some specific Tripp Lite information I can help with, let me know.
David Zomaya
Tripp Lite
________________________________
From: Nut-upsuser <nut-upsuser-bounces+david_zomaya=tripplite.com at alioth-lists.debian.net> on behalf of Charles Lepple <clepple at gmail.com>
Sent: Sunday, December 8, 2019 8:36 PM
To: Layne Fowler