Updating to the latest Mongoid association syntax
has_many_related => references_many belongs_to_related => referenced_in
This commit is contained in:
parent
d5c2494962
commit
8a17394223
@ -7,7 +7,7 @@ class AssetCollection
|
||||
field :slug
|
||||
|
||||
## associations ##
|
||||
belongs_to_related :site
|
||||
referenced_in :site
|
||||
embeds_many :assets
|
||||
|
||||
## behaviours ##
|
||||
|
@ -12,7 +12,7 @@ class ContentType
|
||||
field :api_enabled, :type => Boolean, :default => false
|
||||
|
||||
## associations ##
|
||||
belongs_to_related :site
|
||||
referenced_in :site
|
||||
embeds_many :contents, :class_name => 'ContentInstance' do
|
||||
def visible
|
||||
@target.find_all { |c| c.visible? }
|
||||
|
@ -7,7 +7,7 @@ module Models
|
||||
|
||||
included do
|
||||
|
||||
belongs_to_related :content_type
|
||||
referenced_in :content_type
|
||||
|
||||
field :templatized, :type => Boolean, :default => false
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
class Layout < LiquidTemplate
|
||||
|
||||
## associations ##
|
||||
has_many_related :pages
|
||||
references_many :pages
|
||||
embeds_many :parts, :class_name => 'PagePart'
|
||||
|
||||
## callbacks ##
|
||||
|
@ -8,7 +8,7 @@ class LiquidTemplate
|
||||
field :value
|
||||
|
||||
## associations ##
|
||||
belongs_to_related :site
|
||||
referenced_in :site
|
||||
|
||||
## callbacks ##
|
||||
before_validation :normalize_slug
|
||||
|
@ -6,7 +6,7 @@ class Membership
|
||||
field :admin, :type => Boolean, :default => false
|
||||
|
||||
## associations ##
|
||||
belongs_to_related :account
|
||||
referenced_in :account
|
||||
embedded_in :site, :inverse_of => :memberships
|
||||
|
||||
## validations ##
|
||||
|
@ -16,8 +16,8 @@ class Page
|
||||
field :cache_strategy, :default => 'none'
|
||||
|
||||
## associations ##
|
||||
belongs_to_related :site
|
||||
belongs_to_related :layout
|
||||
referenced_in :site
|
||||
referenced_in :layout
|
||||
embeds_many :parts, :class_name => 'PagePart'
|
||||
|
||||
## callbacks ##
|
||||
|
@ -10,12 +10,12 @@ class Site
|
||||
field :meta_description
|
||||
|
||||
## associations ##
|
||||
has_many_related :pages
|
||||
has_many_related :layouts
|
||||
has_many_related :snippets
|
||||
has_many_related :theme_assets
|
||||
has_many_related :asset_collections
|
||||
has_many_related :content_types
|
||||
references_many :pages
|
||||
references_many :layouts
|
||||
references_many :snippets
|
||||
references_many :theme_assets
|
||||
references_many :asset_collections
|
||||
references_many :content_types
|
||||
embeds_many :memberships
|
||||
|
||||
## validations ##
|
||||
|
@ -15,7 +15,7 @@ class ThemeAsset
|
||||
mount_uploader :source, ThemeAssetUploader
|
||||
|
||||
## associations ##
|
||||
belongs_to_related :site
|
||||
referenced_in :site
|
||||
|
||||
## callbacks ##
|
||||
before_validation :sanitize_slug
|
||||
|
@ -888,7 +888,7 @@ Gem::Specification.new do |s|
|
||||
"vendor/plugins/custom_fields/lib/custom_fields.rb",
|
||||
"vendor/plugins/custom_fields/lib/custom_fields/custom_fields_for.rb",
|
||||
"vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/embeds_many.rb",
|
||||
"vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/has_many_related.rb",
|
||||
"vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/references_many.rb",
|
||||
"vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/proxy.rb",
|
||||
"vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/document.rb",
|
||||
"vendor/plugins/custom_fields/lib/custom_fields/field.rb",
|
||||
|
@ -7,7 +7,7 @@ class Project
|
||||
field :name
|
||||
field :description
|
||||
|
||||
has_many_related :people
|
||||
references_many :people
|
||||
embeds_many :tasks
|
||||
|
||||
custom_fields_for :people
|
||||
|
Loading…
Reference in New Issue
Block a user