Conversation
…than associated 'SquareAsset'
…then making sure there's only one primary_asset
| def build_new_report | ||
| @report = current_user.reports.build(report_params) | ||
| @report.image = Image.new(file: params[:image]) unless params[:image].blank? | ||
| @report.image = PrimaryAsset.new(file: params[:image]) unless params[:image].blank? |
There was a problem hiding this comment.
Should image be changed in this?
There was a problem hiding this comment.
Same question for report model
There was a problem hiding this comment.
Great catch! I'm going to leave these as Image until the Report stuff is refactored.
| :title, :body, :rhino_body, :featured, :published, :position, :youtube_url, | ||
| main_image_attributes: [ :id, :file, :_destroy ], | ||
| gallery_images_attributes: [ :id, :file, :_destroy ], | ||
| primary_media_attributes: [ :id, :file, :_destroy ], |
There was a problem hiding this comment.
| primary_media_attributes: [ :id, :file, :_destroy ], | |
| primary_asset_attributes: [ :id, :file, :_destroy ], |
| has_many :windows_types, through: :projects | ||
| # Images | ||
| has_one_attached :avatar # old paperclip -- TODO convert these to SquareImage belonging to Facilitator | ||
| has_one_attached :avatar |
There was a problem hiding this comment.
Do we want avatar on both user and facilitator or just one?
There was a problem hiding this comment.
I was going to leave it on user for now until post-migration. But, yeah, it's def coming off.
| <%= link_to href, data: { turbo_prefetch: false }, class: "group block focus:outline-none" do %> | ||
| <%# Cover image (16:9), no border %> | ||
| <% if story.respond_to?(:main_image) && story.main_image&.file&.attached? %> | ||
| <% if story.respond_to?(:primary_media) && story.main_image&.file&.attached? %> |
There was a problem hiding this comment.
Does main_image still exist for this?
There was a problem hiding this comment.
Yes, but it should be PrimaryAsset
lib/tasks/rich_text_urls_update.rake
Outdated
| FormField, | ||
| Form, | ||
| Image, | ||
| Media, |
There was a problem hiding this comment.
This needs to find the original model name to build the URL
| Media, | |
| Image, |
There was a problem hiding this comment.
In actuality I don't need all the old models, just the ones with text fields from ckeditor. But for simplicity I added all the models and loop through each text field. The script will error if the model doesn't exist.
There was a problem hiding this comment.
Yuppp. These should be Image. And then yeah we can delete later.
lib/tasks/attachment_report.rake
Outdated
| Category, CategorizableItem, CommunityNews, EventRegistration, Event, | ||
| Facilitator, Faq, FormBuilder, FormFieldAnswerOption, FormField, Form, | ||
| Image, Location, MediaFile, CategoryType, MonthlyReport, Notification, | ||
| Media, Location, MediaFile, CategoryType, MonthlyReport, Notification, |
There was a problem hiding this comment.
| Media, Location, MediaFile, CategoryType, MonthlyReport, Notification, | |
| Image, Location, MediaFile, CategoryType, MonthlyReport, Notification, |
What is the goal of this PR and why is this important?
Images::MainImage,Images::GalleryImage,Images::RichText,Images::Square->PrimaryAsset,SecondaryAsset,RichTextAsset,SquareAssetHow did you approach the change?
MainandGalleryto instead usePrimaryandSecondaryAnything else to add?