サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
Wikipedia
dockyard.com
When writing Elixir apps you’ll typically find yourself building up state in a map. Typically these maps contain deep nesting. Updating anything deeply nested means you have to write something like: my_map = %{ foo: %{ bar: %{ baz: "my value" } } } new_bar_map = my_map |> Map.get(:foo) |> Map.get(:bar) |> Map.put(:baz, "new value") new_foo_map = my_map |> Map.get(:foo) |> Map.put(:bar, new_bar_map
Once you’re ready to deploy your Elixir application to multiple servers, you’ll want to take advantage of the distributed features that the runtime offers. For example, if you are using Phoenix channels, you’ll want broadcasts to be sent across the cluster. You can setup your deployment as a cluster in a few simple steps: Start by creating a new sys.config file in your project. We’ll conventionall
If you are working with Ecto.DateTime in your Phoenix application you may make a comparison of two variables at some point: d1 = {{2015, 11, 30}, {0, 0, 0}} |> Ecto.DateTime.from_erl d2 = {{2015, 11, 29}, {0, 0, 0}} |> Ecto.DateTime.from_erl assert d1 > d2 The above ends up passing the assertion, but only by coincidence. What if you had a situation where you wanted to assert a comparison between t
404 Post not found Uh-oh, looks like someone left the back door open and Narwin got out. We welcome you to learn more about DockYard or explore our Blog about digital product strategy, user experience, design, engineering, and innovation.
{ "tags":[ {"id":1,"name":"Tag #0","note_id":1}, {"id":1001,"name":"Tag #1000","note_id":1}, {"id":2001,"name":"Tag #2000","note_id":1}, ... ], "notes":[ { "id":1, "title":"Note #0", "content":"Lorem ipsum...", "tag_ids":[9001,8001,7001,6001,5001,4001,3001,2001,1001,1] }, { "id":2, "title":"Note #1", "content":"Lorem ipsum...", "tag_ids":[9002,8002,7002,6002,5002,4002,3002,2002,1002,2] } ] } What
I’m happy to announce that Rails 4.0 now has support for PostgreSQL arrays. You can create an array column easily at the time of migration by adding :array => true. Creating an array column will respect the other options you add to the column (length, default, etc). create_table :table_with_arrays do |t| t.integer :int_array, :array => true # integer[] t.integer :int_array, :array => true, :length
This week, I had a pull request accepted into Rails which adds support for PostgreSQL’s MACADDR, INET, and CIDR datatypes. In Rails 4.0, the following migration will be supported: create_table :network_types do |t| t.cidr :cidr_address t.inet :ip_address t.macaddr :mac_address end Also, the schema dumper supports these types as well (previously they would appear as string types in the schema.rb fi
このページを最初にブックマークしてみませんか?
『Custom Software, Mobile & Web App Development, Product Design & Strategy - Do...』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く