Skip to content

update_in_batches should take the same param types as update_all #1

Open
@andyvb

Description

@andyvb

Currently #update_in_batches only accepts Hash, but it should accept the same types of arguments as #update_all (and the same arguments), namely string, array, or hash. Also, might be worth checking if there any arguments that are accepted by both find_in_batches AND update_all, that could conflict?

Anyway doing this:

MyModel.update_in_batches('foo = bar')

Crashes with this:

TypeError: no implicit conversion of Symbol into String
    from .../update_in_batches-0.0.2/lib/update_in_batches.rb:6:in `delete'
    from .../update_in_batches-0.0.2/lib/update_in_batches.rb:6:in `update_in_batches'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions