use .or to fix all sorts of @map.mappings bugs
This commit is contained in:
parent
50f98aebea
commit
18d8929bf1
1 changed files with 7 additions and 6 deletions
|
@ -16,11 +16,12 @@ class Map < ApplicationRecord
|
||||||
has_many :events, -> { includes :user }, as: :eventable, dependent: :destroy
|
has_many :events, -> { includes :user }, as: :eventable, dependent: :destroy
|
||||||
|
|
||||||
# This method associates the attribute ":image" with a file attachment
|
# This method associates the attribute ":image" with a file attachment
|
||||||
has_attached_file :screenshot, styles: {
|
has_attached_file :screenshot,
|
||||||
thumb: ['188x126#', :png]
|
styles: {
|
||||||
#:full => ['940x630#', :png]
|
thumb: ['188x126#', :png]
|
||||||
},
|
#:full => ['940x630#', :png]
|
||||||
default_url: 'https://s3.amazonaws.com/metamaps-assets/site/missing-map-white.png'
|
},
|
||||||
|
default_url: 'https://s3.amazonaws.com/metamaps-assets/site/missing-map-white.png'
|
||||||
|
|
||||||
validates :name, presence: true
|
validates :name, presence: true
|
||||||
validates :arranged, inclusion: { in: [true, false] }
|
validates :arranged, inclusion: { in: [true, false] }
|
||||||
|
@ -31,7 +32,7 @@ class Map < ApplicationRecord
|
||||||
validates_attachment_content_type :screenshot, content_type: /\Aimage\/.*\Z/
|
validates_attachment_content_type :screenshot, content_type: /\Aimage\/.*\Z/
|
||||||
|
|
||||||
def mappings
|
def mappings
|
||||||
topicmappings + synapsemappings
|
topicmappings.or(synapsemappings)
|
||||||
end
|
end
|
||||||
|
|
||||||
def mk_permission
|
def mk_permission
|
||||||
|
|
Loading…
Reference in a new issue