1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/models
Sean Griffin b63d532f1e Don't assume all hashes are from multiparameter assignment in composed_of
So this bug is kinda funky. The code path is basically "if we weren't passed an
instance of the class we compose to, and we have a converter, call that".
Ignoring the hash case for a moment, everything after that was roughly intended
to be the "else" clause, meaning that we are expected to have an instance of
the class we compose to. Really, we should be blowing up in that case, as we
can give a much better error message than what they user will likely get (e.g.
`NameError: No method first for String` or something). Still, Ruby is duck
typed, so if the object you're assigning responds to the same methods as the
type you compose to, knock yourself out.

The hash case was added in 36e9be8 to remove a bunch of special cased code from
multiparameter assignment. I wrongly assumed that the only time we'd get a hash
there is in that case. Multiparameter assignment will construct a very specific
hash though, where the keys are integers, and we will have a set of keys
covering `1..part.size` exactly. I'm pretty sure this could actually be passed
around as an array, but that's a different story. Really I should convert this
to something like `class MultiParameterAssignment < Hash; end`, which I might
do soon. However for a change that I'm willing to backport to 4-2-stable, this
is what I want to go with for the time being.

Fixes #25978
2016-08-05 09:52:09 -04:00
..
admin
autoloadable
publisher
admin.rb
aircraft.rb
arunit2_model.rb
author.rb don't treat all associations with extensions as instance dependent. 2016-03-03 16:52:35 +01:00
auto_id.rb
binary.rb
bird.rb
book.rb
boolean.rb
bulb.rb
cake_designer.rb
car.rb Fixed where for polymorphic associations when passed an array containing different types. 2016-02-16 10:41:26 -08:00
carrier.rb
cat.rb Fix warning: method redefined; discarding old female 2016-03-12 17:06:43 +09:00
categorization.rb
category.rb
chef.rb Add missing source_type if provided on hmt which belongs to an sti record 2016-01-24 22:25:12 +05:30
citation.rb
club.rb
college.rb
column.rb
column_name.rb
comment.rb Allow joins to be unscoped 2016-01-31 02:30:09 +09:00
company.rb
company_in_module.rb
computer.rb
contact.rb
content.rb
contract.rb
country.rb
course.rb
customer.rb Don't assume all hashes are from multiparameter assignment in composed_of 2016-08-05 09:52:09 -04:00
customer_carrier.rb
dashboard.rb
default.rb
department.rb
developer.rb
dog.rb
dog_lover.rb
doubloon.rb
drink_designer.rb
edge.rb
electron.rb
engine.rb
entrant.rb
essay.rb
event.rb
eye.rb
face.rb
friendship.rb
guid.rb
guitar.rb
hotel.rb Add missing source_type if provided on hmt which belongs to an sti record 2016-01-24 22:25:12 +05:30
image.rb
interest.rb
invoice.rb
item.rb
job.rb
joke.rb
keyboard.rb
legacy_thing.rb
lesson.rb
line_item.rb
liquid.rb
man.rb
matey.rb
member.rb
member_detail.rb
member_type.rb
membership.rb
mentor.rb
minimalistic.rb
minivan.rb
mixed_case_monkey.rb
mocktail_designer.rb Add missing source_type if provided on hmt which belongs to an sti record 2016-01-24 22:25:12 +05:30
molecule.rb
movie.rb
node.rb
notification.rb Ensure suppressor runs before validations 2016-02-24 14:33:22 -05:00
order.rb
organization.rb
owner.rb Fix undefined method `owners' for NullPreloader:Class 2016-04-06 00:46:55 -03:00
parrot.rb
person.rb
personal_legacy_thing.rb
pet.rb Fix undefined method `owners' for NullPreloader:Class 2016-04-06 00:46:55 -03:00
pet_treasure.rb Fix undefined method `owners' for NullPreloader:Class 2016-04-06 00:46:55 -03:00
pirate.rb
possession.rb
post.rb
price_estimate.rb
professor.rb
project.rb
publisher.rb
randomly_named_c1.rb
rating.rb
reader.rb
recipe.rb
record.rb
reference.rb
reply.rb
ship.rb
ship_part.rb
shop.rb
shop_account.rb
speedometer.rb
sponsor.rb
string_key_object.rb
student.rb
subject.rb
subscriber.rb
subscription.rb
tag.rb
tagging.rb
task.rb
topic.rb Oracle TIMESTAMP sql type is associated with Rails DateTime type now 2016-07-20 13:10:55 +00:00
toy.rb
traffic_light.rb
treasure.rb
treaty.rb
tree.rb
tuning_peg.rb
tyre.rb
user.rb Correctly return associated_table when associated_with? is true 2016-07-10 11:42:51 +09:00
uuid_child.rb
uuid_item.rb Fix issue #23625 2016-02-18 00:32:38 -05:00
uuid_parent.rb
vegetables.rb
vehicle.rb
vertex.rb
warehouse_thing.rb
wheel.rb
without_table.rb
zine.rb