Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 02 22:02
    repomaa synchronize #438
  • Feb 24 14:55
    SlayerShadow closed #437
  • Feb 24 14:55
    SlayerShadow commented #437
  • Feb 24 01:27
  • Feb 24 01:20
  • Feb 24 01:18
  • Feb 22 21:09
  • Feb 22 17:25
    renich commented #1245
  • Feb 22 17:14
    renich commented #1245
  • Feb 22 05:24
    drujensen closed #1245
  • Feb 22 05:24
    drujensen commented #1245
  • Feb 22 05:24
    drujensen closed #1247
  • Feb 22 05:24
    drujensen commented #1247
  • Feb 22 05:20

    drujensen on master

    reset back to master (compare)

  • Feb 22 05:19

    drujensen on stable

    (compare)

  • Feb 22 05:19

    drujensen on stable

    (compare)

  • Feb 22 05:19

    drujensen on v0.36.0

    (compare)

  • Feb 22 05:19

    drujensen on master

    Bumped version number to v0.36.… (compare)

  • Feb 22 05:19
    utshahGSW30 commented #1232
  • Feb 22 05:18

    drujensen on crystal-0.36.0

    (compare)

Damian Hamill
@damianham

sorry, clarifying: query for "tags contains X" for example, please and thank you

@vectorselector I don't know if it is the best approach but what I do is create View models with a select_statement that does the joins on the relevant tables which is then easy to filter with #all() or #where() and it is 1 database query.

Rene Bon Ćirić (Renich)
@renich_gitlab
@eliasjpr maybe it's a good idea to post this in GitHub? As a ticket?
Damian Hamill
@damianham
I am planning for the future and considering the architecture of the backend APIs and databases. We will be developing a number of distinct services, each of which will have their own distinct set of database tables. I am most likely going to deploy the APIs on server clusters in distinct sub-domains for each service. Some of the database records in each service will be owned by a User and there will be one common user identity across all services. Should this grow to a very large user base we would need to ensure there are no bottlenecks with database access and I suppose the common approach would be to cluster the database and all services would use the same database cluster. An alternative would be to segregate the database tables into distinct databases for each service with a separate database for user records and any other common tables. The obvious disadvantage is the inability to join tables between the different databases. Does anyone have any thoughts, pros or cons on this kind of setup?
Elias Perez
@eliasjpr
Hello Damian, when I worked for Stash I was responsible the for user identity, authentication and authorization, and a Postgres database worked just fine with approx 5 million active users we also had a caching layer REDIS that offload the dB quite a bit
Damian Hamill
@damianham
@eliasjpr thanks mate. Was that a single Postgres instance for just the user identity, authentication and authorization or was a general server instance for the whole service? what was the server configuration ?
Elias Perez
@eliasjpr
Single AWS RDS instance, the database was for the identity service which had 2 main functions authentication and authorization. It would also store all PII information for a user. PII info only certain clients had access and depending on their Sox and pci scope data would be scrubbed
Configuration would look something like #
Load balancer -> main service => (Redis Cache, Postgres)
Damian Hamill
@damianham
:thumbsup: thanks mate.
Rene Bon Ćirić (Renich)
@renich_gitlab

I'm trying to use:

before_action do
  only [:new, :edit] { get_referrer }
end

...

  private def get_referrer
    @referrer = Referrer.all("ORDER BY name ASC")
  end

But I get:

In src/controllers/prospect_controller.cr:73:7

 73 | @referrer = referrer
      ^--------
Error: can't infer the type of instance variable '@referrer' of ProspectController

The type of a instance variable, if not declared explicitly with
`@referrer : Type`, is inferred from assignments to it across
the whole program.

The assignments must look like this:

  1. `@referrer = 1` (or other literals), inferred to the literal's type
  2. `@referrer = Type.new`, type is inferred to be Type
  3. `@referrer = Type.method`, where `method` has a return type
     annotation, type is inferred from it
  4. `@referrer = arg`, with 'arg' being a method argument with a
     type restriction 'Type', type is inferred to be Type
  5. `@referrer = arg`, with 'arg' being a method argument with a
     default value, type is inferred using rules 1, 2 and 3 from it
  6. `@referrer = uninitialized Type`, type is inferred to be Type
  7. `@referrer = LibSome.func`, and `LibSome` is a `lib`, type
     is inferred from that fun.
  8. `LibSome.func(out @referrer)`, and `LibSome` is a `lib`, type
     is inferred from that fun argument.

Other assignments have no effect on its type.

can't infer the type of instance variable '@referrer' of ProspectController
I mean, if I use: referrer = Referrer.all, it works, but, then, how do I pass it to the view? (I wanted to add a blank option)
My plan was to:
@referrer.reverse! << [nil, ""]; @referrer.reverse!
... or something like that...
Rene Bon Ćirić (Renich)
@renich_gitlab

Ah, neither this works:

@date = "#{@prospect.date.to_s("%Y-%m-%d")}" unless @prospect.date.nil?

It says:


01:21:57 watch.run (Info) Building...
Showing last frame. Use --error-trace for full trace.

In src/controllers/prospect_controller.cr:23:31

 23 | @date = "#{@prospect.date.to_s("%Y-%m-%d")}" unless @prospect.date.nil?
                                ^---
Error: no overload matches 'Nil#to_s' with type String

Overloads are:
 - Nil#to_s(io : IO)
 - Nil#to_s()
 - Object#to_s(io : IO)
 - Object#to_s()

I dunno what's wrong in that last one. I am, clearly, telling it to assign that in unless date isn't nil.

I'll try the ternary operator...

Rene Bon Ćirić (Renich)
@renich_gitlab
doesn't work either.... :S
George Dietrich
@Blacksmoke16
if date = @prospect.date
Rene Bon Ćirić (Renich)
@renich_gitlab

if date = @prospect.date

Will try that...

Rene Bon Ćirić (Renich)
@renich_gitlab

Nope; doesn't work:

  def edit
    if date = @prospect.date
      @date = @prospect.date.to_s("%Y-%m-%d")
    end

Error:

[renich@introdesk rafita]$ amber w
2021-02-18T03:50:13.390177Z   INFO - watch.run: Building...
09:50:13 watch.run (Info) Building...
Showing last frame. Use --error-trace for full trace.

In src/controllers/prospect_controller.cr:23:29

 23 | @date =@prospect.date.to_s("%Y-%m-%d")
                            ^---
Error: no overload matches 'Nil#to_s' with type String

Overloads are:
 - Nil#to_s(io : IO)
 - Nil#to_s()
 - Object#to_s(io : IO)
 - Object#to_s()
2021-02-18T03:50:17.208579Z   INFO - watch.run: Compile time errors detected, exiting...
09:50:17 watch.run (Info) Compile time errors detected, exiting...
:cry:
George Dietrich
@Blacksmoke16
no
if date = @prospec.date
  @date = date
end
Rene Bon Ćirić (Renich)
@renich_gitlab

OK, look, this works:

  def edit
    if date = prospect.date
      date = date.to_s("%Y-%m-%d")
      render "edit.slang"
    end
  end

But, now, I cannot reference date on the view... :S

if date = @prospec.date
  @date = date
end
I'll try that one

With:

  def edit
    if date = prospect.date
      @date = date
      render "edit.slang"
    end
  end

I get:

10:59:58 watch.run (Info) Building...
Showing last frame. Use --error-trace for full trace.

In src/controllers/prospect_controller.cr:23:7

 23 | @date = date
      ^----
Error: can't infer the type of instance variable '@date' of ProspectController

The type of a instance variable, if not declared explicitly with
`@date : Type`, is inferred from assignments to it across
the whole program.

The assignments must look like this:

  1. `@date = 1` (or other literals), inferred to the literal's type
  2. `@date = Type.new`, type is inferred to be Type
  3. `@date = Type.method`, where `method` has a return type
     annotation, type is inferred from it
  4. `@date = arg`, with 'arg' being a method argument with a
     type restriction 'Type', type is inferred to be Type
  5. `@date = arg`, with 'arg' being a method argument with a
     default value, type is inferred using rules 1, 2 and 3 from it
  6. `@date = uninitialized Type`, type is inferred to be Type
  7. `@date = LibSome.func`, and `LibSome` is a `lib`, type
     is inferred from that fun.
  8. `LibSome.func(out @date)`, and `LibSome` is a `lib`, type
     is inferred from that fun argument.

Other assignments have no effect on its type.

can't infer the type of instance variable '@date' of ProspectController
Same error with:
  def edit
    if date = prospect.date
      date = date.to_s("%Y-%m-%d")
      @date = date
      render "edit.slang"
    end
  end

Like I said, this builds:

  def edit
    if date = prospect.date
      date = date.to_s("%Y-%m-%d")
      render "edit.slang"
    end
  end

But I cannot use either: value=date or value="#{date}"

... in the edit view.
George Dietrich
@Blacksmoke16
i mean where do you define what @date is?
prob just need to add like @date : String? somewhere
Rene Bon Ćirić (Renich)
@renich_gitlab
OK, I'll try that.

prob just need to add like @date : String? somewhere

Hah! That worked!

George Dietrich
@Blacksmoke16
i mean yea, thats what the error has been telling you
Rene Bon Ćirić (Renich)
@renich_gitlab
Well, I'm just too dumb
man... I've been struggling with this for days... maybe a week...
George Dietrich
@Blacksmoke16
:grimacing:
Rene Bon Ćirić (Renich)
@renich_gitlab
Thanks a lot @Blacksmoke16 . You really helped me! ;D
George Dietrich
@Blacksmoke16
np
Marwan Rabbâa
@waghanza

Hi @eliasjpr,

In order to keep the project healthy we would like to onboard New maintainers to Amber Framework

I have a suggestion about that, at least I hope it could work. amber is listed in the-benchmarker/web-frameworks#3858, I hope maintainers could be interested by amber if it come on the first place (I take care of this). I can see that amber, at least master branch is working (for the benchmark) on 0.36.
There is 2 solutions to allow me promote crystal and amber

  • wait for a release of actual master
  • use directly master
    Honestly, I prefer the first solution. Would a release be feasible ?
Elias Perez
@eliasjpr
@waghanza we can push a release of Amber
Marwan Rabbâa
@waghanza
it will be awesome
Elias Perez
@eliasjpr
Im going to work on it over the weekend
Marwan Rabbâa
@waghanza
:heart:
Isaac Sloan
@elorest

@eliasjpr @drujensen I apologize for being mostly absent for 2 years. My work load has been insane.
I'm pretty sure that Crystal is going to reach 1.0 very soon, and there are more and more companies every year using it.
We're still using crystal and a slightly older version of amber at work. Unfortunately our needs don't overlap a lot with most peoples use of a web framework so we haven't pushed that code up.

Anyway I just want to say to all the contributors that it's been amazing working with you and I really hope we can keep this project going even if its just maintaining compatibility with the most recent releases of crystal which will hopefully be 1.0. :)

Elias Perez
@eliasjpr
@elorest there you are!! Thanks for dropping the kind message. Let’s catch up at some point
Isaac Sloan
@elorest
Yeah definitely. I'd love to.
Kyle Manning
@IwateKyle
can anyone give some advice. I just started tinkering with Crystal recently. And just yesterday started with Amber. I couldn't find any documentation for migrations - how to modify - update - etc.
3 replies
Rob
@rnice01
Is there a way to configure the database for a local amberframework.org? The docs on https://github.com/amberframework/amberframework.org seem outdated as the config/db.yml was deleted in a commit as it was unused I guess. I'm wanting to help out with the docs.
2 replies
Faustino Aguilar
@faustinoaq
Hi @elorest @eliasjpr @drujensen and all amber community, also sorry for being offline all this time. Getting all my notifications updated, so I can see what to collaborate first. Feeling great this new year :smile:
New version v0.36.0 already available on AUR https://aur.archlinux.org/packages/amber/ :+1:
Isaac Sloan
@elorest
@faustinoaq It's great to hear from you. How have you been?