noosfero | WIP: Rails 5.1.6 Upgrade (!1438)
Álax Alves
gitlab at mg.gitlab.com
Thu May 24 10:50:56 BRT 2018
Álax Alves commented on a discussion on app/models/block.rb:
>
> delegate :environment, :to => :box, :allow_nil => true
>
> - acts_as_list scope: -> block { where box_id: block.box_id }
> + acts_as_list scope: :box
>
> - belongs_to :box
> - belongs_to :mirror_block, :class_name => "Block"
> - has_many :observers, :class_name => "Block", :foreign_key => "mirror_block_id"
> + belongs_to :box, optional: true
Because of Rails' new convention, every `belongs_to` association is now required by default, that's why I have created the initializer `active_record_belongs_to_required_by_default.rb`, so that the associations that are not required by default in models now need to have this explicit declaration `optional: true`
--
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1438#note_74823965
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180524/c104bbc1/attachment.html>
More information about the Noosfero-dev
mailing list