Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Igor Alexandrov
    @igor-alexandrov
    Yup, it works
    Wout
    @wout
    I'll create a PR for Lucky so we can do form_for Profile::Create, multipart: true, which is what most people would expect.
    Igor Alexandrov
    @igor-alexandrov
    But I have two problems with this:
    Wout
    @wout
    The first one is probably an easy fix. For the time being we can test with adding a regular param, but I'll tackle that.
    Igor Alexandrov
    @igor-alexandrov
    Maybe it is very easy to fix, but it is very annoying, since I cannot just upload an image now, I should add a Title or something else :)
    Wout
    @wout
    The second one is a bit harder to wrap my head around, but shouldn't that be needs instead of attribute? As in needs asset : Lucky::UploadedFile
    Maybe it is very easy to fix, but it is very annoying
    Absolutely!
    I'll try to fix it today, so we can maybe include it in the next release.
    Igor Alexandrov
    @igor-alexandrov

    I'll try to fix it today, so we can maybe include it in the next release.

    Great!

    What is the difference between needs and attributes?
    Wout
    @wout
    With needs, you define arguments for the initializer. I believe the only way right now to use files in operations is to pass them explicitly to the operation.
    Igor Alexandrov
    @igor-alexandrov
    Yes, I already got this. In Lucky room David pasted a link to Lucky extensions for the String.
    Wout
    @wout
    Great.
    Igor Alexandrov
    @igor-alexandrov
    My current idea is that we should add the same extensions to Shrine and this will give us an ability to do the following:
    class SaveImage < Image::SaveOperation
      param_key :image
    
      attribute asset : ImageUploader::Attachment
      attribute title : String
    end
    what do you think?
    Wout
    @wout
    Yes, that would be much better.
    Wout
    @wout
    @igor-alexandrov I've been looking at the issue you have with operations raising Lucky::MissingNestedParamError.
    Could it be you are calling the operation like this: SaveImage.create(params, upload)?
    Where params is empty and upload = params.nested_file?(:image)["file"]?
    Because the params are optional, so if you use SaveImage.create(upload), that should work without issues.
    Wout
    @wout
    I've opened an issue to document this: luckyframework/website#330
    Wout
    @wout
    The PR for multipart: true in form_for is waiting for approval: luckyframework/lucky#1200
    I'm now working on Avram to polish file uploads and I hop to get it finished this weekend.
    And I was also wondering, have you already done any work on implementing your Fastimage shard for the dimensions plugin? If not, I can take care of that as well if you want.
    Wout
    @wout
    Today I completed the majority of the work required for Avram to play more nicely with Shrine. You can see the WIP here: luckyframework/avram#396
    Hopefully we can ship this quickly. :)
    Igor Alexandrov
    @igor-alexandrov
    Hello
    I've been very busy last couple of days
    Will try to review everything starting from tomorrow
    Wout
    @wout
    No worries. It's not ready yet.
    Wout
    @wout
    So, I've finalized the PR: luckyframework/avram#404
    If that's merged, you'll be able to do this:
    class SaveImage < Image::SaveOperation
      param_key :image
    
      attribute asset : ImageUploader::Attachment
      attribute title : String
    end
    Given that ImageUploader::Attachment includes Avram::Uploadable.
    Wout
    @wout
    I'm now researching multi-file uploads.
    Igor Alexandrov
    @igor-alexandrov
    wow wow!
    great job, dude!
    Wout
    @wout
    Thanks :)
    Igor Alexandrov
    @igor-alexandrov
    I am still occupied with production work...
    Wout
    @wout
    No pressure. ;)
    Igor Alexandrov
    @igor-alexandrov
    we have a code freeze on Friday...
    so you know... everything is going not expected these days
    Wout
    @wout
    Sounds familiar...
    Igor Alexandrov
    @igor-alexandrov

    Given that ImageUploader::Attachment includes Avram::Uploadable.

    We will be able to reach this with a plugin

    Francisco Cordero
    @franciscoGPS
    image.png
    Hi guys. After adding shrine as a dependency, and running shards install, i'm having this error. Is anyone else having this or know how to solve it? Thanks in advance
    Sean Gregory
    @skinnyjames
    @franciscoGPS I got that too, I had to lock shrine at 0.6.4
    shrine:
    github: jetrockets/shrine.cr
    version: ~> 0.6.4
    hey all, is the metadata["filename"] option supposed to set the actual filename?
        uuid = UUID.random.to_s
        str = "#{uuid}#{extension}"
        # e5333b2f-d934-4b93-8ff2-c06b3f2d915b.jpg
        Shrine.upload(File.new(file.tempfile.path), "cache", metadata: { "filename" => str })
       # saves as b72e96c87dac868dcd7042a2d949cfd5.jpg