Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 20 18:22
    eliasjpr labeled #1256
  • Apr 20 18:22
    eliasjpr opened #1256
  • Apr 20 18:21

    eliasjpr on dj-crystal-1.0.0-rev

    Ignore crystal version (compare)

  • Apr 20 16:10
    renich commented #1255
  • Apr 20 16:07
    renich commented #1255
  • Apr 20 15:58
    renich opened #1255
  • Apr 19 12:32
    eliasjpr synchronize #1253
  • Apr 19 12:32

    eliasjpr on dj-crystal-1.0.0

    Update shard.yml Uses crystal … (compare)

  • Apr 19 12:14
  • Apr 18 04:11
    backward-crazy-mage-puppy-36 commented #1251
  • Apr 13 11:53
    backward-crazy-mage-puppy-36 commented #1251
  • Apr 10 06:51
    renich commented #1251
  • Apr 09 03:02
    kematy opened #1254
  • Apr 04 22:02
    drujensen edited #1253
  • Apr 04 22:01
    drujensen opened #1253
  • Apr 04 22:00

    drujensen on dj-crystal-1.0.0

    update to crystal 1.0.0 (compare)

  • Apr 04 21:59
    drujensen commented #1251
  • Apr 04 21:52
    drujensen commented #1252
  • Apr 04 21:24
    InstanceOfMichael opened #1252
George Dietrich
@Blacksmoke16
See amberframework/granite#331. Not actually sure where the json_support doc page went, but thats prob how you'd want to do it
vectorselector
@vectorselector
yeah, i can't even figure out how to see the 'master' branch on github without cloning the repo and switching to it, doh... i don't see that json_support doc either... but anyway, there's essentially this on_to_json callback?
Anyway, I didn't understand the part about 'This would include a "members" property in the json output with a value of your members.'
Would this bring-in all Model.members under the "members" key?
George Dietrich
@Blacksmoke16
of which on_to_json is a thing that gets called after the ivars have been serialized, e.g. so you can add more data
since relationships in Granite are methods, they aren't picked up by default via serializable, so you can use that on_to_json method to add them after the fact, which would set members JSON key, to the array of members you'd get if you did like model.members
i.e. not all members, but only those related to that specific model instance
vectorselector
@vectorselector
oh, that's exactly what i need.
thank you very much George
vectorselector
@vectorselector
oh, this is great... it works perfectly.
George Dietrich
@Blacksmoke16
:thumbsup:
Leandro Rezende
@LeandroRezendeCoutinho
Kirill Kulikov
@ikaru5
:tada: :tada: :tada: :tada: :tada: :tada: :tada: :tada: :tada: :tada: :tada: :tada: :tada: :tada: :tada: :tada: :tada:
Jong
@dare892
Hey all! Still pretty new to crystal so just noob question.
Trying to use granite - is there a way to bulk delete with condition? (ex> delete from table where id < 1000;)
George Dietrich
@Blacksmoke16
pretty sure you can do like Model.exec "DELETE FROM TABLE WHERE id < 1000;"
but ofc that wont run any callbacks etc
Jong
@dare892
gotcha, it would be nice to have the callbacks but if that's not built in then i'll have to find a way around it...
thanks!
George Dietrich
@Blacksmoke16
what are your callbacks doing?
Jong
@dare892
not much atm, but later I will need to keep track of few fields from the rows that were deleted. For now I think it will work, thanks!
George Dietrich
@Blacksmoke16
:thumbsup:
Kirill Kulikov
@ikaru5
Anyone tried amber with crystal 1? :)
Marwan Rabbâa
@waghanza
compilation is failing @ikaru5, but should probably be a quick fix to add v1 support
as done in https://github.com/crystal-loot/exception_page/pull/21/files
Matt Lankford
@lankford
Hi All, noob trying to get going. Started a project with standard "new" but webpack takes forever (and all tests failing while starting) so decided to do a new --minimal... now I get an error about the layouts :

Code in macro 'render'

16 | render_template("layouts/#{false}", "src/views")
^
Called macro defined in lib/amber/src/amber/controller/helpers/render.cr:33:13

33 | private macro render_template(filename, path = "src/views")

Which expanded to:

1 | Kilt.render("#{"src/views"}/"layouts/#{false}"")
^
Error: expecting token ')', not 'layouts'

any thoughts?
George Dietrich
@Blacksmoke16
what did you pass to render?
Matt Lankford
@lankford

class HomeController < ApplicationController
def index
render("index.slang")
end
end

and index.slang just has an H1 tag in it

George Dietrich
@Blacksmoke16
welp there goes my idea :/
Matt Lankford
@lankford
;) Thanks for thinkin' of me tho!
Matt Lankford
@lankford
if I say layout: false it renders the H1 tag "hello world" basically
Matt Lankford
@lankford
Just to introduce myself, I have been out of dev / ops for a few years, but I have used Ruby since before Rails and Rails since pre 1.x I guess... I used to read the entire Ruby standard lib about once a year, pretty well versed in MySQL (used mSQL before that), can hack my way around Postgres and Linux since before the SLS distro... I'm on mac now and it's a bit older 2015 I guess... just updated it but had a bunch of permissions problems getting brew to get everything install correctly... Tried using asdf which is kind of cool but I don't do a lot of heavy javascript these days (used to use it quite a bit) love the idea behind Opal ... not a huge frontend guy but understand CSS. I have a few sites I need to make that will prbly be done in Hugo but I have a few things I need server side for... really looking for the simplest dev path... read all the docs for Webpack and like the concept, just seems overly complicated for what I need... read the docs on Amber / it's ORM and Lucky ... would love pointers to a simple mid 2000s style rails (ish) path but keep getting blocked by rookie mistakes to get up and running like the macro problem above... looked at lucky, but it seemed like a backend version of React that I don't object to too much, but seems like it would take a lot longer for someone with my experience to come up to speed with... Also curious about others doing projects with Amber / other frameworks / etc
George Dietrich
@Blacksmoke16
https://github.com/veelenga/awesome-crystal#web-frameworks there are some other options. http://athenaframework.org/ is pretty interesting, but imo it depends on what you're wanting to do as each framework has their pros and cons
Matt Lankford
@lankford
Thanks George, checking them out now.
Matt Lankford
@lankford
OK George... sorted it out... it's cuz I'm an idiot... forgot the LAYOUT=
George Dietrich
@Blacksmoke16
:thumbsup:
Matt Lankford
@lankford
I have a project I am wanting to get off the ground and could use some help, as I said, I am pretty well versed in ruby / rails / etc, but don't have the time needed to come up to speed with a new environment on my own... I would be interested in talking to (and paying) someone about helping me get off the ground with things like getting setup / pair programming ... I can already scaffold things and have an idea of what is going on but I like having a mentor to show me the ropes...
George Dietrich
@Blacksmoke16
oh sorry, maybe someone else would be interested but i actually never used amber
Matt Lankford
@lankford
No worries George... thought I sent it to the whole group
George Dietrich
@Blacksmoke16
oops, i just assumed it was directed at me :P
aaaScript
@aaaScript

I'm wondering if anyone here as encountered an Uncaught (in promise) DOMException: An invalid or illegal string was specified error while using the amber.js file for WebSocket connections. I'm currently trying to connect to my Amber websocket endpoint from a Vue application which is where I'm getting this error, the odd thing is that I can get it working standalone from the DevTools browser console via a simple HTLM file, just not within Vue.

Been bashing my head on this for a few days now. Any help or direction will be appreciated since I can't find many resources/tutorials on the amber.js file.

aaaScript
@aaaScript
Nvm. Figured it out. It looks like the browser was prepending the local url to what I was specifying during the amber Socket declaration.
Damian Hamill
@damianham

I have a project I am wanting to get off the ground and could use some help, as I said, I am pretty well versed in ruby / rails / etc, but don't have the time needed to come up to speed with a new environment on my own... I would be interested in talking to (and paying) someone about helping me get off the ground with things like getting setup / pair programming ... I can already scaffold things and have an idea of what is going on but I like having a mentor to show me the ropes...

Hi Matt - one way of getting going with something beyond the standard app is to use a recipe. Disclaimer: I wrote the recipe feature for Amber and some of the recipes out there so I am in favour of that option :) The recipes I contributed are a bit out of date but there is all kinds of stuff implemented in them which you can use as a basis for your projects. In particular there are some recipes with a React SPA frontend. If you follow the Recipes section of the documentation you should be able to get going with a recipe for an earlier version of Amber. Then it's a case of updating the shard.yml to the latest version of crystal, amber and all the dependencies and fixing the deprecated stuff and breaking changes. To find out what the dependency versions should be create an amber app with the latest version and compare the shard.yml. The problem you then face is dependency hell in the Javascript side of things. I am completely moving away from Javascript front ends and adopting Flutter for all front end development, my projects are primarily mobile based anyway but Flutter is now available for the web in stable branch so I will be trying it soon.

Matt Lankford
@lankford
Hey Damian… that sent me down a few rabbit holes… I will check out a few of the Recipes … they sound kind of like what I am looking for…
George Dietrich
@Blacksmoke16
@drujensen wouldn't it be better to drop support for json_mapping and yaml_mapping so you dont have 1.0.0 relying on already deprecated libs?
Dru Jensen
@drujensen
@Blacksmoke16 Yes, but Amber has dependencies like ameba that we don't have control over so it wouldn't help.
George Dietrich
@Blacksmoke16
but ameba doesnt depend on those
just amber which is the main thing
aaaScript
@aaaScript
Would anyone happen to have any amber websocket examples on implementing authentication?
Håkan Nylén
@confact
Why am I getting Array(Int64) | Int64 on count on granite and not just an Int64? How can I handle that in a good way?
George Dietrich
@Blacksmoke16
Can you share the code?