faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
<FromGitter> <anamba> jasper's select_field doesn't appear to handle multiple select. is that correct? i can look into fixing it, but wanted to confirm first. i'm still new to all this (jasper, amber, crystal).
<FromGitter> <elorest> My belief is that it does handle multiple select. What have you tried?
<FromGitter> <elorest> Ok so multiple select will work but won’t auto select more than one previously selected value.
<FromGitter> <elorest> `select_field(:pets, [[1, “dog”], [2, “cat”], [3, “lizard”], [4, “parrot”]], multiple: true)`
<FromGitter> <elorest> If you could set it up to take in an array of selected values and compare against all of them on this line. https://github.com/amberframework/jasper-helpers/blob/master/src/jasper_helpers/forms.cr#L60
<FromGitter> <elorest> And write a test to prove it works.
<FromGitter> <elorest> Off the top of my head it would look like this: ⏎ ⏎ https://gist.github.com/elorest/414e28812520a585fbf909649ed489a8
<FromGitter> <anamba> yeah, the part about not being able to go back and edit (`selected` not accepting an array) was what i meant by not working. i could have been more specific. :) the way you suggested makes sense to me, i'll try that. and will submit a PR (assuming you don't get to it first).
<FromGitter> <anamba> ok, github.com is in some kind of crazy split-brain state right now, making life very difficult. i'll check back later.
_whitelogger has joined #amber
<FromGitter> <anamba> Created PR #31.
<FromGitter> <benbonnet> hello all, getting into amber (step by step rather than with the full generator); just wondering how to start properly the minimal configuration example (https://docs.amberframework.org/amber/examples/minimal-configuration). passing the filename as a cli parameter ? does `amber watch` would work with such a config ?
<FromGitter> <c910335> in your shard.yml ⏎ `name: api`
<FromGitter> <benbonnet> @c910335 thx alot! i see here it starts now
<FromGitter> <benbonnet> things do work. that is, amber watch seem to include some kind of "npm watcher"
<FromGitter> <benbonnet> can it be excluded ?
feepbot has quit [Ping timeout: 240 seconds]
feepbot has joined #amber
<FromGitter> <Blacksmoke16> its prob a thing watching for front end js/css changes
<FromGitter> <Blacksmoke16> @robacarp @drujensen I had a thought last night
<FromGitter> <Blacksmoke16> it would be a super breaking change, but i was wondering if it would be possible to change the field macro to not be a macro, but annotation based
<FromGitter> <Blacksmoke16> like
<FromGitter> <Blacksmoke16> ```@[Granite::Column] ⏎ property first_name : String``` [https://gitter.im/amberframework/amber?at=5be327ff92b7d1172151d20b]
<FromGitter> <Blacksmoke16> then json/yaml/custom annotations would work
<FromGitter> <Blacksmoke16> also gives you other features like
<FromGitter> <Blacksmoke16> `@[Granite::Column(name: "col_first")]`
<FromGitter> <Blacksmoke16> any property that doesnt have an annotation would be virtual, existing on model but not persisted
<FromGitter> <Blacksmoke16> i might take a stab at it just for the fun of it
<robacarp> annotations are kind of a mystery to me, but thats because I haven't done anything with them
<FromGitter> <Blacksmoke16> their pretty cool, my other project https://github.com/Blacksmoke16/CrSerializer, uses them for stuff like this
<FromGitter> <Blacksmoke16> way i imagine it we would just iterate over instance_vars in the `__process_fields` macro
<FromGitter> <Blacksmoke16> if the annotation is set add it to the `CONTENT_FIELDS`
<FromGitter> <Blacksmoke16> if name is present use that as the column name, otherwise ivar name
<FromGitter> <Blacksmoke16> then base `PRIMARY` on if any annotation has `primary: true`
<FromGitter> <Blacksmoke16> otherwise use the Int64 auto inc
<FromGitter> <Blacksmoke16> but will come down to do we think its worth the breaking change, and assuming the implementation works out. I'll keep you posted on a prototype
feepbot has quit [Ping timeout: 276 seconds]
feepbot has joined #amber
<FromGitter> <Blacksmoke16> awe, i dont think it'll work
<FromGitter> <Blacksmoke16> dont have access to the ivars outside of a method
<FromGitter> <RubyRebbe> I want to put a birth date in a Person model object in Granite. In Amber generate model, what is the correct type for the field? And can I assign a Crystal lang. Time object to that field?
<FromGitter> <Blacksmoke16> Time would work yea
<FromGitter> <Blacksmoke16> Or string, depends on what you want to do with it
<FromGitter> <RubyRebbe> Thanks @Blacksmoke16 . I want to do a query (where ...) finding all persons with a birth date in a particular range: from_date , to_date
<FromGitter> <Blacksmoke16> Hmm
<FromGitter> <Blacksmoke16> Should be doable