Displaying 13 results from an estimated 13 matches similar to: "validates_uniqueness_of (with :scope) doesn't seem to work?"
2008 Sep 23
3
Finding distinct months using find_by_sql
Hello,
I''m wondering if someone might be able to offer me a solution to the
following problem that has so far stumped me.
I''m trying to get the distinct months (and years) from a date field to
display as a list in a view. For example, there might be a number of
records stored with dates in the table ''headlines'':
name date
record1 21-09-2008
record2
2009 Apr 07
3
assert_valid in unit tests after upgrade to rails 2.3 doesn't work
def test_valid
assert_valid State.first
end
Error:
test_valid(StateTest):
NoMethodError: undefined method `assert_valid'' for #<StateTest:
0x7f0d60750318>
I see that test_valid is now in
ActionController::Assertions::ModelAssertions. Does this mean that
test_valid is designed to be used i ActionController tests only?
I can change my assert_valid(State.first) into assert
2011 Jan 01
4
Saving the monitor file on new file always using Monitor(wav, Record1, m)
Dear List;
For each call (in specific case), I need to do a record and save in a spearated file, so I am thinking the best thing is to save based on the time.
Monitor(wav,Record1,m)
So, how can I make the file name to be based on the current time (which is changed always, or based on the some unique paramter (related to the call it self).
Any advise?
Regards
Bilal
2006 Jul 20
11
3 columns
Hi all,
Not really sure what to put in the title so hope people still open this!
What I want to do is produce something like this
Col1 Col2 Col3
data1 data2 data3
data4 data5 data6
data7 data8 data9
data.. data.. data..
data.. data.. data..
data-n data-n+1 data-n+2
I can get the data back from my db
2011 Nov 04
1
problem when exiting from "record file" function without pressing the escape digit
Hi everybody,
I've been working on a project which records the voice of the incoming call.
I use record_file function of asterisk as described below:
RECORD FILE <filename> <format> <escape digits> <timeout> [offset samples]
[BEEP] [s=<silence>]
filename: record1
format: wav
escape digits: #
timeout: -1
offset samples: 0
BEEP: 1
silence: 3000
*Please read the
2007 Feb 07
0
strange sqlite3 errors - validates_associated & failing activerecord unit tests
I''m getting two strange errors, both which I believe relate to sqlite3.
The first one is with validates associated. Here is my test:
require File.dirname(__FILE__) + ''/../test_helper''
class SubscriptionPlanTest < Test::Unit::TestCase
fixtures :subscription_plans
fixtures :publications
def setup
@six_month_gold = subscription_plans(:six_month_gold)
2018 Jul 20
0
Mount with Relay: Fallback-override does not work
Hello,
I'm using Icecast over 10 years, so let me first say *Thank you to all
developers* of Icecast!
I have a problem using a mount with relay and a fallback. The option
<fallback-override> is not working.
I tested two different configurations:
_Configuration A:_
<mount>
<mount-name>/Stream-096k.mp3</mount-name>
2006 Sep 29
7
help needed in UNIT Testing
hi guys,
I needed help in Unit test. i just try to save new data intomy test
database.
but save method does not works for me. the result shows here
def test_new_avail
avail = Avail.new(:vendor_id => 1,
:last_mod_by => ''Murali'',
:updated_at => ''2006-08-17 13:14:59)
assert avail.valid?
assert avail.save
end
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 =>
2018 Aug 03
2
Mount with Relay: Fallback-override does not work
Hello,
I'm using Icecast over 10 years, so let me first say *Thank you to all
developers* of Icecast!
I have a problem using a mount with relay and a fallback. The option
<fallback-override> is not working.
I tested two different configurations:
_Configuration A:_
??? <mount>
??????? <mount-name>/Stream-096k.mp3</mount-name>
???????
2004 Nov 23
4
oh323/g729 and DTMF
Hi everyone,
Could somebody enlighten me on this one? I have
configured my asterisk to run on oh323 using codec
g729. Incoming calls are working okay. But the thing I
want to work is say pressing some options, say dial 1
to go to voicemail or dial a certain number to dial a
specific extension.
I have a config for this and tried calling from a
normal PSTN and is working. But i just can't seem
2006 Jul 24
1
Testing w/out DB connection
I have several plain ruby classes that do nothing but implement
algorithms. What is the prefferred way to run these w/out making a DB
connection every time?
Thanks,
Dennis Byrne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060724/5ff610dd/attachment.html
2006 Jul 11
4
assert fails with <false> is not true
Hi,
I have a simple model and written a testcase.
class Product < ActiveRecord::Base
validates_presense_of :name
end
-------------
class ProductTest < Test::Unit::TestCase
fixtures :products
def test_invalid
product = Product.new
assert !product.valid?
end
end
-------------
The testcase fails with a message,
<false> is not true.
What is wrong with the testcase? I