Displaying 12 results from an estimated 12 matches for "field_type".
2006 Feb 19
2
possible rails -> postgresql bug
Hi I have a problem accessing an array field in a Postgresql database.
Here is the table definition.
View "neil.flashing_codes"
Column | Type | Modifiers
-------------+-----------------------+-----------
code | character varying(10) |
description | text |
folds | integer[] |
View definition:
SELECT
2006 Mar 01
3
Form helpers and overloaded methods - help!
Can someone explain why form helpers appear to bypass any model methods
I override for fields that are bound to database fields? It would be
great if someone could tell me how to force the form field, etc to call
the method instead of looking at the database / attributes collection.
Let''s say I have a column called ''price'' in my database table "books"
2006 May 18
3
populating array of text_fields from an array of model objects
I have in my view the following:
<% 0.upto(@num_performances) do |idx| -%>
<%= text_field ''performance'', ''city'', :index => idx, %>
<%= text_field ''performance'', ''venue'', :index => idx, %>
<% end -%>
and in my controller I have:
@performance = [Performance.new("city" =>
2006 Mar 10
14
Oracle Date type errors rails on edit
I have a table with "expires_on" a DATE field.
"Show" and "Destroy" work, but "Edit" errors:
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/date_helper.rb:150:in
`select_hour''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/date_helper.rb:149:in
`select_hour''
It only happens when
2006 Aug 15
0
ActiveRecord inheritance with types table
I have a Field class:
class Field < ActiveRecord::Base
belongs_to :field_type
end
with it''s table:
fields:
id
field_type_id
name
ordering
every field has a type
class FieldType < ActiveRecord::Base
end
stored in the field_types table
field_types:
id
name
class_name
for each field type, there''s a subclass of Field that do whatever...
2006 Apr 06
3
Formating Float ActiveRecord attributes in text inputs
I have AMOUNT field that ActiveRecord maps to Float.
Then I use text_field helper to generate text inputs on forms.
Helper takes model object and attribute name and does not provide any
formatting abilities, thus 2.40 is shown as 2.4 which is fine with
floats but does not look good with currency.
I have worked around this issue by adding amount_f attribute to the
model that returns formatted
2006 Feb 05
0
Enum patch for Rails
...es << item
+ end
+ values
+ end
+
+ def extract_limit_or_enum_values(sql_type)
+ if type == :enum
+ extract_enum_values(sql_type)
+ else
+ extract_limit(sql_type)
+ end
+ end
+
def simplified_type(field_type)
case field_type
when /int/i
@@ -157,6 +180,8 @@
:string
when /boolean/i
:boolean
+ when /enum/i
+ :enum
end
end
end
Index:
activerecord/lib/active_record/connection_adapters/mysql_a...
2005 Aug 17
1
RODBC and sqlColumns
...TABLE_NAME COLUMN_NAME
DATA_TYPE
[6] TYPE_NAME PRECISION LENGTH SCALE
RADIX
[11] NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE
SQL_DATETIME_SUB
[16] CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE DISPLAY_SIZE
FIELD_TYPE
<0 rows> (or 0-length row.names)
But there is no test table defined anywhere else but the X schema. If I
do sqlSave(db,aDataFrame,"X.test",T,F), it says test already defined. If
I change the aDataFrame to be different than the fields actually in the
data, then R starts to c...
2005 Nov 18
6
wrong number of arguments (2 for 1) error message help
...the user
@user.reload
@item.user = @user
if @item.save
itemtablename = "Item_#{@item.id}"
ActiveRecord::Schema.define do
create_table(itemtablename, :options => ''ENGINE=InnoDB
DEFAULT CHARSET=utf8'') do |t|
t.column :field_type, :string, :null => false
t.column :body, :text, :null => true
t.column :required, :tinyint, :null => false, :default => ''0''
t.column :demographic, :tinyint, :null => false, :default
=> ''0''
t.column :imag...
2008 Jul 04
1
datatype problem when using ActiveRecord with Oracle
...find
the source of the problem and I found oracle_adapter.rb (http://
www.koders.com/ruby/fidAF6400E299159A198A4064173CF305C895FCA945.aspx?s=%22Michael+Schoen%22#L5)
has a method ''simplified_field'' that has a line
"return :boolean if OracleAdapter.emulate_booleans && field_type ==
''NUMBER(1)''".
I tried overriding this method on my environment.rb and commented out
this line. This problem is solved but I have another field of type
''Interval'' which has to get mapped to String, but instead gets mapped
to Fixnum when i do this override....
2006 Jul 08
9
How to handle dynamically columned tables in rails
I want to build an application that lets me (the end user accessing a
web page) design a simple list with columns and add records. E.g., if
the end user says I want a table that has a list of songs, he can create
a list (title, date, artist, label) and then make another list of, e.g.,
books on his bookshelf with the necessary columns (title, author,
pub_date, shelf).
The end user
2010 Mar 25
1
A file with extension .sdb in a codebook section of a large database from a survey?
The TIMSS2007 database http://timss.bc.edu/TIMSS2007/idb_ug.html seems
to provide "both kinds" of universal data formats - either SPSS saved
data sets or SAS saved data sets. (Yes, I am being sarcastic.)
These, of course, are accompanied by massive codebooks explaining the
nature of each of the fields in the data sets. The T07_Codebooks.zip
file available at that site contains .pdf