Skip to content

Commit

Permalink
Fix issue with seeding content (*38)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed Tewiah committed Nov 6, 2017
1 parent b86b431 commit 96a24e9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
* Add Portuguese as an admin language
* Add preset color palettes
* Require Rails 5.1.0 or above
* Fix issue with seeding content (#38)

## 1.2.0 / 2017-08-23

Expand Down
2 changes: 1 addition & 1 deletion app/models/pwb/contact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Contact < ApplicationRecord
has_many :messages
belongs_to :primary_address, optional: true, class_name: "Address", foreign_key: 'primary_address_id'
belongs_to :secondary_address, optional: true, class_name: "Address", foreign_key: 'secondary_address_id'
belongs_to :user
belongs_to :user, optional: true

# enum title: [ :mr, :mrs ]
# above method of declaring less flexible than below:
Expand Down
2 changes: 1 addition & 1 deletion app/models/pwb/link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Link < ApplicationRecord
# globalize_accessors locales: [:en, :ca, :es, :fr, :ar, :de, :ru, :pt]
globalize_accessors locales: I18n.available_locales

belongs_to :page, foreign_key: "page_slug", primary_key: "slug"
belongs_to :page, optional: true, foreign_key: "page_slug", primary_key: "slug"

# below needed to avoid "... is not an attribute known to Active Record" warnings
attribute :link_title
Expand Down

0 comments on commit 96a24e9

Please sign in to comment.