Afficher un message
Vieux 18/09/2007, 20h42   #8
ara.t.howard
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [ANN] arrayfields-4.1.0


On Sep 18, 2007, at 8:41 AM, Stephen Bannasch wrote:

> $ script/console
> Loading development environment.
>>> OtmlFile.find_by_path("../../concord/otrunk-examples/
>>> BasicExamples/basic_drawing.otml")

> => #<OtmlFile:0x330ebf4 @attributes={"name"=>"basic_drawing.otml",
> "id"=>"1", "path"=>"../../concord/otrunk-examples/BasicExamples/
> basic_drawing.otml"}>
>>> require 'arrayfields'

> => ["PseudoHash", "Arrayfields", "Pseudohash", "Fieldable",
> "FieldedArray", "ArrayFields", "Fieldedarray"]
>>> OtmlFile.find_by_path("../../concord/otrunk-examples/
>>> BasicExamples/basic_drawing.otml")



thanks.

cfp:~ > rails test --database=sqlite3 > /dev/null 2>&1 && cd test


cfp:~/test > ./script/console
Loading development environment.

>> c = ActiveRecord::Base.connection

=> #<ActiveRecord::ConnectionAdapters::SQLite3Adapter :0x345227c
@connection=#<SQLite3:atabase:0x3462c44
@statement_factory=SQLite3::Statement, @results_as_hash=true,
@transaction_active=false, @handle=#<SWIG::TYPE_p_sqlite3:0x34522a4>,
@translator=nil, @driver=#<SQLite3:river::Native:river:0x345236 c
@callback_data={}, @trace={}, @busy_handler={}, @authorizer={}>,
@type_translation=false, @closed=false>, @last_verification=0,
@runtime=0, @logger=#<Logger:0x367331c @logdev=#<Logger::LogDevice:
0x3673164 @filename="script/../config/../config/../log/
development.log", @mutex=#<Logger::LogDevice::LogDeviceMutex:
0x3673074 @mon_owner=nil, @mon_waiting_queue=[], @mon_entering_queue=
[], @mon_count=0>, @dev=#<File:script/../config/../config/../log/
development.log>, @shift_size=1048576, @shift_age=0>, @formatter=nil,
@default_formatter=#<Logger::Formatter:0x36731f0
@datetime_format=nil>, @level=0, @progname=nil>>

>> c.execute ' create table foos( a text, b text ) '

=> []

>> class Foo < ActiveRecord::Base; end

=> nil

>> Foo.create :a => '4', :b => '2'

=> #<Foo:0x344a3c4 @errors=#<ActiveRecord::Errors:0x3447b10 @errors=
{}, @base=#<Foo:0x344a3c4 ...>>, @attributes={"a"=>"4", "b"=>"2",
"id"=>1}, @new_record=false>

>> Foo.find_by_a '4'

=> #<Foo:0x3443ec0 @attributes={"a"=>"4", "b"=>"2"}>

>> Foo.find_by_b '2'

=> #<Foo:0x34419a4 @attributes={"a"=>"4", "b"=>"2"}>

>> require 'arrayfields'

=> ["ArrayFields", "Fieldedarray", "Arrayfields", "PseudoHash",
"Fieldable", "Pseudohash", "FieldedArray"]

>> p Arrayfields.version

"4.2.0"
=> nil

>> Foo.find_by_a '4'

=> #<Foo:0x342bfb4 @attributes={"a"=>"4", "b"=>"2"}>

>> Foo.find_by_b '2'

=> #<Foo:0x3429a98 @attributes={"a"=>"4", "b"=>"2"}>


on rubyforge now.

a @ http://drawohara.com/
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama




  Réponse avec citation
 
Page generated in 0,07211 seconds with 9 queries