On Thursday, May 23, 2013 3:54:39 AM UTC-4, Rafael Almeida wrote:
>
> ... at least throws an exception rather than generating '(---\n- 1\n- 
> 2\n','---\n- 3\n- 4\n)'. Otherwise, if you're adding random characters ...
>

They are not random characters.

mkdir tmp
cd tmp
git clone git://github.com/rails/rails.git
grep -r \\-\\-\\- *

Notice things like:

  execute <<_SQL
    CREATE TABLE defaults (
    id serial primary key,
    modified_date date default CURRENT_DATE,
    modified_date_function date default now(),
    fixed_date date default '2004-01-01',
    modified_time timestamp default CURRENT_TIMESTAMP,
    modified_time_function timestamp default now(),
    fixed_time timestamp default '2004-01-01 00:00:00.000000-00',
    char1 char(1) default 'Y',
    char2 character varying(50) default 'a varchar field',
    char3 text default 'a text field',
    positive_integer integer default 1,
    negative_integer integer default -1,
    bigint_default bigint default 0::bigint,
    decimal_number decimal(3,2) default 2.78,
    multiline_default text DEFAULT '--- []

'::text
);
_SQL

See that multiline_default? Then a google search for: rails 
multiline_default shows this commit:
https://github.com/rails/rails/commit/4eaa8ba5bec9001e97349e7dfd565c7215085834

Maybe that has something to do with it? Maybe shouldn't be raising an error 
because some might be using that? I don't know.

Maybe you could add something so that this is supported:

MyModel.where([:a, :b] => [[1,2],[3,4]])
MyModel.where([:a, :nice, :triple] => [[1,2,3],[4,5,6]])
MyModel.where([:any, :number, :of, :members] => [[1,2,3,4],[5,6,7,8]])

but if you did:

MyModel.where([:a, :b] => [[1,2],[3,[4,5]]])

maybe the [4,5] would render as the wierd multiline string version of the 
array for that specific part of the tuple's second value.

I'm not sure whether that would break anything, but if it did then could 
just have a different method name like where_tuple(...) to do that.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to