Displaying 5 results from an estimated 5 matches for "english_name".
2006 Jan 19
5
123 * 3 => 123123123! But why?
...currency_code
rates = { :USD => 1,
:CHF => 0.75,
:EUR => 1.1,
:GBP => 3.1
}
value = rates[code.to_sym]
raise "No conversion rate found for currency ''#{code}''
(#{Locale.active.language.english_name})!" if value.nil?
value
end
def dollar_part
na? ? nil : cents / 100 / conversion_rate
end
def cent_part
na? ? nil : cents % 100 / conversion_rate
end
end
end
--------
Sadly I get ugly results like
$99.00 # correct!
SFr. 132,0.00 # incorrect!
? 90,0,0...
2011 Jul 25
5
Arel quiz: complex queries with associations
..."?
> Person.where("name like ''A%''").count
I''m not having as much success with more complicated ones like these:
all people grouped by language, then alphabetized by name
this sorts people by name not language:
> Person.order(:name, {:language => :english_name}).all.map { |p| puts
"#{p.name} #{p.language.english_name}" }
how many people tweet in french?
> Person.where(:tweets => {:language_id => ''fr''}).count
(0.1ms) SELECT COUNT(*) FROM "people" WHERE "tweets"."language_id" =
0
SQLit...
2005 May 22
1
ActiveRecord: can not connect to mysql
Hi
I would like to write my first application with Active
Record:
this is my database table:
id PRIMAREY KEY auto_increment
german_name varchar(50)
english_name varchar(50) |
wingspan
this is my code:
=======================
#!/usr/local/bin/ruby -w
require ''rubygems''
require_gem ''activerecord'', ">= 1.10.1"
ActiveRecord::Base.establish_connection(
:adapter => "mysql",
:host =>...
2006 Jun 05
0
Failed to install Globalize plugin
..._639_2)
-> 0.2200s
-- add_index(:globalize_languages, :iso_639_3)
-> 0.2300s
-- add_index(:globalize_languages, :rfc_3066)
-> 0.2910s
rake aborted!
Mysql::Error: Data too long for column ''currency_format'' at row 1:
INSERT INTO globalize_countries (`id`, `code`, `english_name`,
`date_format`, `currency_format`, `currency_code`, `thousands_sep`,
`decimal_sep`, `currency_decimal_sep`, `number_grouping_scheme`) VALUES
(''100'', ''IL'', ''Israel'', NULL, ''%n ?'', ''ILS'', '','...
2007 Aug 07
4
Execute additional commands after creating database?
...t:clone
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
rake aborted!
PGError: ERROR: schema "rails" does not exist
: CREATE TABLE rails.globalize_countries ("id" serial primary key,
"code" character varying(2) DEFAULT NULL, "english_name" character
varying(255) DEFAULT NULL, "date_format" character varying(255)
DEFAULT NULL, "currency_format" character varying(255) DEFAULT NULL,
"currency_code" character varying(3) DEFAULT NULL, "thousands_sep"
character varying(2) DEFAULT NULL, "de...