has_array_of:PostgreSQL数组上的ActiveRecord关联

时间:2021-05-08 00:04:52
【文件属性】:
文件名称:has_array_of:PostgreSQL数组上的ActiveRecord关联
文件大小:29KB
文件格式:ZIP
更新时间:2021-05-08 00:04:52
Ruby HasArrayOf 警告:该宝石尚在开发中,尚未发布。 该插件使用PostgreSQL数组的功能实现了在Rails中进行has_and_belongs_to_many关联的替代方法。 在很多情况下,你只需要或的功能使用许多一对多与连接表是不必要的传统方法。 我们可以只存储id的整数数组。 它是如何工作的? 假设我们有一个包含许多视频的播放列表。 一个视频可以包含在许多播放列表中。 这是典型的多对多情况,但我们的实施方式有所不同。 # db/migrate/20141027125227_create_playlist.rb class CreatePlaylist < ActiveRecord :: Migration def change create_table :playlists do | t | t . integer :video_ids , a
【文件预览】:
has_array_of-master
----gemfiles()
--------activerecord_4.2.gemfile.lock(3KB)
--------activerecord_6.0.gemfile(283B)
--------activerecord_edge.gemfile.lock(3KB)
--------activerecord_5.2.gemfile(283B)
--------activerecord_5.1.gemfile(283B)
--------activerecord_5.2.gemfile.lock(3KB)
--------activerecord_5.0.gemfile(285B)
--------activerecord_6.0.gemfile.lock(3KB)
--------activerecord_5.1.gemfile.lock(3KB)
--------activerecord_edge.gemfile(281B)
--------activerecord_4.2.gemfile(277B)
--------activerecord_5.0.gemfile.lock(3KB)
----.github()
--------workflows()
----MIT-LICENSE(1KB)
----lib()
--------has_array_of()
--------has_array_of.rb(128B)
----Gemfile(669B)
----Guardfile(319B)
----has_array_of.gemspec(1KB)
----spec()
--------has_array_of()
--------spec_helper.rb(899B)
--------support()
----Rakefile(678B)
----.travis.yml(522B)
----README.md(2KB)
----Appraisals(592B)
----.rspec(30B)
----Gemfile.lock(3KB)
----.gitignore(146B)

网友评论