Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot put 2 ActiveRecords of different classes in the same array #105

Open
softwaregravy opened this issue Sep 6, 2018 · 0 comments
Open

Comments

@softwaregravy
Copy link

Putting 2 objects of different active record classes into the same array causes an exception:

irb(main):001:0> c1 = MyFirstClass.first
irb(main):002:0> c2 = MySecondClass.first
irb(main):003:0> [c1, c2]
    .../ruby-2.4.4@XXX/gems/activemodel-5.2.0/lib/active_model/attribute_methods.rb:430:in `method_missing'
    .../ruby-2.4.4@XXX/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:10:in `block (2 levels) in render'
    .../ruby-2.4.4@XXX/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:10:in `each'
    .../ruby-2.4.4@XXX/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:10:in `inject'
    .../ruby-2.4.4@XXX/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:10:in `block in render'
    .../ruby-2.4.4@XXX/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:9:in `each'
    .../ruby-2.4.4@XXX/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:9:in `inject'
    .../ruby-2.4.4@XXX/gems/hirb-0.7.3/lib/hirb/helpers/object_table.rb:9:in `render'
    .../ruby-2.4.4@XXX/gems/hirb-0.7.3/lib/hirb/helpers/auto_table.rb:22:in `render'
    .../ruby-2.4.4@XXX/gems/hirb-0.7.3/lib/hirb/formatter.rb:73:in `_format_output'
    .../ruby-2.4.4@XXX/gems/hirb-0.7.3/lib/hirb/formatter.rb:56:in `format_output'
    .../ruby-2.4.4@XXX/gems/hirb-0.7.3/lib/hirb/view.rb:205:in `render_output'
    .../ruby-2.4.4@XXX/gems/hirb-0.7.3/lib/hirb/view.rb:123:in `view_output'
    .../ruby-2.4.4@XXX/gems/hirb-0.7.3/lib/hirb/view.rb:201:in `view_or_page_output'
    .../ruby-2.4.4@XXX/gems/hirb-0.7.3/lib/hirb/view.rb:187:in `output_value'
    .../ruby-2.4.4@XXX/rubies/ruby-2.4.4/lib/ruby/2.4.0/irb.rb:494:in `block (2 levels) in eval_input'   
...

rails 5.2.0
ruby 2.4.4
hirb 0.7.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant