active-hash / active_hash

A readonly ActiveRecord-esque base class that lets you use a hash, a Yaml file or a custom file as the datasource
MIT License
1.2k stars 179 forks source link

Defines the getter method for the collection_singular_ids. #237

Closed 1160054 closed 2 years ago

1160054 commented 2 years ago

Defines the getter method for the collection_singular_ids.

ex:

Author.has_many :books

Book.create! :author_id => 1
Book.create! :author_id => 1
Book.create! :author_id => 3

author.book_ids => [1,2]

Resolve this issue
https://github.com/zilkey/active_hash/issues/236

kbrock commented 2 years ago

this is a great one.

Very surprised this was not already in there and also surprised it has not been merged