Displaying 20 results from an estimated 3000 matches similar to: "scopes related question"
2008 Jan 19
1
Decimals are being converted to Bigdecimals!!!!!
Hi all,
I''m working on a financial app, and have set up some columns in my
tables as decimals with precision => 8 and scale => 2. My migration
looks like:
change_column :lineitems, :price, :decimal, :precision =>
8, :scale => 2
change_column :payments, :amount, :decimal, :precision =>
8, :scale => 2
I''ve run the migration and restarted the server. I
2005 Dec 20
2
Modifying data before update or save
Hi,
I''d like to upcase a variable before it is saved, but I''m not sure how
to access the incoming param or where this work should be performed:
In my update method, I have:
@device = Device.find(params[:id])
params[:device[macaddress]].upcase <-- problem code
if @device.update_attributes(params[:device])
....usual stuff here
''macaddress'' is the
2011 Sep 07
4
rspec testing inheritance
Hello,
Is there any way to test model inheritance in spec?
something like..
it { ChildModel.should < ParentModel }
thanks.
2011 Jan 07
1
Calculating Returns : (Extremely sorry for earlier incomplete mail)
Dear R forum helpers,
I am extremely sorry for the receipt of my incomplete mail yesterday. There was connectivity problem at my end and so I chose to send the mail through my cell, only to realize today about the way mail has been transmitted. I am again sending my complete mail through regular channel and sincerely apologize for the inconvenience caused.
## Here is my actual mail
Dear R
2010 Aug 18
2
[PATCH] Don't show vlan interfaces in NIC host management
Signed-off-by: Arthur Clement <aclement at linagora.com>
---
src/host-browser/host-register.rb | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/host-browser/host-register.rb b/src/host-browser/host-register.rb
index 693a6f2..5ff6a90 100755
--- a/src/host-browser/host-register.rb
+++ b/src/host-browser/host-register.rb
@@ -393,13 +393,18 @@ class
2008 Jun 29
2
How to write test about validates_associated
Here is my model:
class Account < ActiveRecord::Base
has_many :users, :dependent => :destroy
has_many :bus
belongs_to :currency
has_many :mylogs, :dependent => :destroy
has_many :batchuserdefines, :dependent => :destroy
has_many :materialuserdefines, :dependent => :destroy
has_many :materials
has_many :inventories
has_many :batchs
has_many :courses
has_many
2006 Mar 03
1
number_to_currency() helper == non DRY == could be improved
Hi all,
Apologies in advance if I got this one wrong, I''m still just a
newbie ;-)
Going through the Apple ADC RoR tutorial it suddenly occurred to me
that the ''number_to_currency()'' helper method was not DRY streamlined.
Scenario::
The "number_to_currency()" methods options hash works great when I
need to dynamically display different currencies when I
2011 Feb 02
6
how to set default_scope for the whole application?
I know I can set default_scope for individual active record model, but
can I set one up for the whole application?
thanks
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
2013 Apr 03
4
Better way of writing R code
Dear R forum,
(Pl note this is not a finance problem)
I have two data.frames as
currency_df = data.frame(current_date = c("3/4/2013", "3/4/2013", "3/4/2013", "3/4/2013"), issue_date = c("27/11/2012", "9/12/2012", "14/01/2013", "28/02/2013"), maturity_date = c("27/04/2013", "3/5/2013",
2006 Apr 18
4
upcase special chars (åäöü...)?
Hey guys
How do you upcase the special characters (????)?
I use latin-1 and not utf-8.
How did you solve this problem? (nice ruby way or ugly hack doesnt
matter)
Daniel
--
Posted via http://www.ruby-forum.com/.
2006 Mar 25
4
Rails PayPal and Currencies other than USD
Has anyone been able to make direct API calls to PayPal in currencies
other than USD? I get an error message "The currency code submitted is
not supported. Check the currency code and try again."
I''m using the PayPal plugin for Rails. I can successfully transact in
USD, but not AUD (Australian Dollars).
Cheers,
Dan
2011 Jan 07
1
Currency return calculations
Dear sir, I am extremely sorry for messing up the logic
asking for help w.r.t. my earlier mails
I have tried to explain below what I am looking for.
I have a database (say, currency_rates) storing datewise
currency exchange rates with some base currency XYZ.
currency_rates <- data.frame(date =
c("12/31/2010", "12/30/2010", "12/29/2010",
2013 Apr 25
1
Linear Interpolation : Missing rates
Dear R forum
I have data.frame as
df = data.frame(rate_name = c("USD_1w", "USD_1w", "USD_1w", "USD_1w", "USD_1m", "USD_1m", "USD_1m", "USD_1m", "USD_2m", "USD_2m", "USD_2m", "USD_2m", "GBP_1w", "GBP_1w", "GBP_1w", "GBP_1w",
2010 May 10
6
feedback on a few ActiveSupport::Multibyte patches
Hi all,
In response to Rodrigo Rosas''s message about mb_chars.upcase not
giving the expected result on 1.9, I''ve done some work in a fork to
make String#mb_chars always return an instance of a proxy class, both
with Ruby 1.8 and Ruby 1.9. The end result of the patch is
(hopefully) to make Rails'' multibyte functionality behave the same way
in 1.8.7 and 1.9.x.
2007 Nov 18
2
Variable inside of another variable
Hi everyone,
I''m building partial and I need to use a variable inside of another
variable name:
I''ve tried like this:
<div class="form_row">
<label for="<%= field %>"><%= field_title || field.humanize %>:</
label>
<%= form.text_field field,
:size => User::field.upcase_SIZE,
2006 Jan 17
2
money data types
What data type is best for storing currency? I''m trying to come up
with a reliable cross-database solution for rails that is not too
complicated. Since I''m going to have currency fields all over the
place, I''m not so sure that using two integer fields for each amount
would qualify as uncomplicated. I''d like to be able to use database
functions like SUM to
2013 Apr 16
3
Splitting the Elements of character vector
Dear R forum
I have a data.frame
df = data.frame(currency_type = c("EURO_o_n", "EURO_o_n", "EURO_1w", "EURO_1w", "USD_o_n", "USD_o_n", "USD_1w", "USD_1w"), rates = c(0.47, 0.475, 0.461, 0.464, 1.21, 1.19, 1.41, 1.43))
currency_type rates
1 EURO_o_n 0.470
2 EURO_o_n 0.475
3 EURO_1w 0.461
2011 Sep 07
6
FactoryGirl doesnt produce unique names?!
Hey,
I got following very simple test case:
require ''spec_helper''
describe Country do
it "should create a new instance given valid attributes" do
Factory(:country)
end
end
Factory looks like:
Factory.sequence :country_name do |n|
"Country #{n}"
end
Factory.define :country do |c|
c.name Factory.next(:country_name)
c.nationality "Foo
2007 May 15
3
NOOB question RSPEC
Hi all !!
I have this code:
require ''account''
describe Account, "when first created" do
before do
@account = Account.new
end
it "should have a balance of $0" do
@account.balance.should eql(Money.new(0, :dollars))
end
after do
@account = nil
end
end
How can I pass the @account.balance.should eql(Money.new(0, :dollars))
spec. From my
2006 Apr 07
5
Are there any Czech people using Rails?
Hello,
how do you solve the problems with czech characters? Do you use unicode
or ISO-8859-2/WIN1250? How do use methods like String:upcase etc. that
dont use czech characters?
I would appreciate any hints for this.
Thanks,
David Marko
--
Posted via http://www.ruby-forum.com/.