Essentially after any edit of any js file if we reload /qunit it takes us about 10 seconds for the page to render.
- Mar 2021
-
github.com github.com
-
-
I was debugging our painfully slow reload times in Discourse when running qunit.
-
-
github.com github.com
-
but I still have no idea if I'm writing this new file correctly.
-
-
github.com github.com
-
we want source maps in production (like DHH)
-
I totally understand that there may be a majority still considering this a bad practice and thus keeping it disabled by default in production seem ok. But there could at least be an option to enable it for people who want to, no?
-
After waiting years for sprockets to support this we were very happy to see that sprockets 4 officially added support (thanks ), but then when trying to upgrade we noticed there's actually no way to use it in production... (without brittle hacks mentioned above).
-
I'd be happy to open a PR for this, but I'm not sure exactly what code needs to change. default_source_map.rb and source_map_utils.rb seem like candidates, but I'd appreciate guidance
Tags
- reasonable defaults
- irony
- rails: the Rails way
- sad/unfortunate conclusion
- best practices
- the needs/wishes of a minority
- official preferred convention / way to do something
- unfortunate
- contributing: offering to help
- missing configuration option or way to customize this behavior
- can be disabled by default but at least provide a way to opt in if needed
Annotators
URL
-
-
-
If the bug is still there I think that it is better if it is open so others can find it if they run into the same issue.
-
-
github.com github.com
-
The way we do it currently is by calling load from inside of load, via different "pipelines" and processors which is quite elegant and completely impossible to work with.
-
If I can find some time, maybe I can help pitch in somehow.
-
I'm kinda stuck at the moment, going around in circles. Everything is really heavily coupled. I would like to get to the point where no load is called from within processors, but i'm not sure if that's possible. Currently the API and the caching strategies are fighting me at every step of the way. I have a branch where i'm hacking through some refactoring, no light at the end of the tunnel yet though :(
-
Money could be good if it is spent to provide some of the above things. Money on it's own is hard because then it means I would have to spend time book-keeping and managing instead of programming.
Tags
- requires a big/non-trivial refactoring/rewrite
- elegant solution
- hard to understand
- requires a non-trivial change
- doing what you love: leaving what's boring to you for others
- hard/costly to change later
- contributing: offering to help
- fun wording
- boring
- pipeline
- seemingly contradictory
- too coupled/dependent
- hard to follow/read/understand
- hard to figure out where the problem lies / how to solve the problem / where to even begin
- bookkeeping
- receiving money: is it worth the hassle/responsibility of bookkeeping?
- unfun
- good point
- work: doing what you love
- contributing
Annotators
URL
-
-
theanarchistlibrary.org theanarchistlibrary.org
-
<small><cite class='h-cite via'>ᔥ <span class='p-author h-card'>nastroika</span> in Natalia: Liberation Through Automation! - The Meta Course / meta-course-8 - Hyperlink Forum (<time class='dt-published'>03/10/2021 14:43:34</time>)</cite></small>
-
-
github.com github.com
-
Reopening #162
https://github.com/rails/sprockets/issues/162 was already closed as duplicated (so this just creates another duplicate).
Technically this could be added there.
Oh, I see, it was from so long ago (2015), that it would probably be frowned upon to reopen such an old issue.
-
-
-
it's super hard to test master because i have no idea which gems need to be updated. is there a guide on how to take a rails 4.2 project to master sprockets without everything mysteriously exploding? ill try to make a repro case but its hard to tell where to even start
-
-
opalrb.com opalrb.com
-
Opal is a Ruby to JavaScript source-to-source compiler. It comes packed with the Ruby corelib you know and love. It is both fast as a runtime and small in its footprint.
-
-
docs.openfaas.com docs.openfaas.com
-
OpenFaaS® makes it easy for developers to deploy event-driven functions and microservices to Kubernetes without repetitive, boiler-plate coding.
-
-
hyperstack.org hyperstack.org
-
Hyperstack gives you full access to the entire universe of JavaScript libraries and components directly within your Ruby code.Everything you can do in JavaScript is simple to do in Ruby; this includes passing parameters between Ruby and JavaScript and even passing Ruby methods as JavaScript callbacks.There is no need to learn JavaScript, all you need to understand is how to bridge between JS and Ruby.
-
-
www.codetriage.com www.codetriage.com
-
Better yet, send them a link to this page to help them understand why and how to make an example app:
-
If you end up finding and fixing a bug in your code, consider re-reading the documentation and seeing if that behavior of the library is unclear. Consider sending a documentation PR.
-
Before a bug can be fixed, it has to be understood and reproduced. For every issue, a maintainer gets, they have to decipher what was supposed to happen and then spend minutes or hours piecing together their reproduction. Usually, they can’t get it right, so they have to ask for clarification. This back-and-forth process takes lots of energy and wastes everyone’s time. Instead, it’s better to provide an example app from the beginning. At the end of the day, would you rather maintainers spend their time making example apps or fixing issues?
Tags
- good explanation
- wasteful/inefficient use of resources
- avoid wasting maintainers' time so they have more time to work on important things
- minimal reproducible example
- providing an example app (minimal reproducible example)
- a dedicated page for an issue/convention/recommendation that you can easily link to / share with others
- opportunity to improve/fix something
Annotators
URL
-
-
github.com github.com
-
I don't myself understand what's going on, it clearly has something to do with source maps, but may also have to do with other sprockets changes.
-
But yeah, I'm not sure how you would determine which was the "recommended way" really. I don't see anything in Rails docs saying either way.
-
But last I have seen comments from DHH, he considered webpack(er) recommended for JS, but Sprockets still the preferred solution for (S)CSS.
-
I don't really understand what's going on. Clearly source maps have something to do with it -- a source map feature that doesn't handle SCSS very well, apparently.
-
Is there a PR to... something? sassc-rails? That would make the patch not necessary? (I don't know if there's any good way to monkey-patch that in, I think you have to fork? So some change seems required...) Should the defaults be different somehow? This is very difficult to figure out.
-
I agree about lack of maintenance. It's probably because people use more and more Webpack.
Tags
- webpack
- where (which project) do I even report this problem/bug? (whose responsibility is it?)
- abandoning/migrating away from
- unfortunate that this is no longer maintained
- hard to figure out where the problem lies / how to solve the problem / where to even begin
- sprockets
- switching/migrating from Sprockets to Webpack (Rails)
- don't understand even what's going on, let alone how to go about finding/identifying/fixing the problem
- official preferred convention / way to do something
- switching/migrating to something different
- falling out of favor
- shift in preference
Annotators
URL
-
-
math.stackexchange.com math.stackexchange.com
-
I think that over time the distinction is lost. My math teacher, 35 years ago stated "formulas are used in chemistry, in math we have equations". To this day, the word 'formula' in math seems wrong, but I'd accept it's used commonly.
-
An equation is any expression with an equals sign, so your example is by definition an equation. Equations appear frequently in mathematics because mathematicians love to use equal signs. A formula is a set of instructions for creating a desired result. Non-mathematical examples include such things as chemical formulas (two H and one O make H2O), or the formula for Coca-Cola (which is just a list of ingredients). You can argue that these examples are not equations, in the sense that hydrogen and oxygen are not "equal" to water, yet you can use them to make water.
-
-
-
We don’t want to invalidate the input if the user removes all text. They may need a moment to think, but the invalidated state sets off an unnecessary alarm.
-
-
stackoverflow.com stackoverflow.com
-
You can use the :placeholder-shown pseudo class. Technically a placeholder is required, but you can use a space instead.
-
There is (currently) no CSS selector for detecting directly whether an input control has a nonempty value, so we need to do it indirectly, as described above.
-
-
store.steampowered.com store.steampowered.com
-
If you plan on using a gamepad with big picture mode I made a config that works perfectly so check it out.
-
There are myriads of platformers around, it's an oversaturated market, and just like industrial designer Karim Rashid said about there being no excuse by this point to make an uncomfortable chair, there's no excuse by this point to make a boring patformer.
-
-
css-tricks.com css-tricks.com
-
Assuming wonderful support, this is how the logic would play out…
-
:placeholder-shown is super useful for us here! It’s basically the secret selector for testing if an input currently has a value or not.
-
You’d think :empty would be it, but it’s not. That’s for matching things like <p></p>… container elements with nothing inside them. Inputs are no-content elements already.
-
always use real <label for="correct_input"> elements. Just that alone is a UX consideration all too many forms fail on
-
-
tylergaw.com tylergaw.com
-
My collection (this isn’t all of it) grows at a comical pace.
-
Having them in a physical form is good for my soul.
-
This is a non-exhaustive list of other things I love;
-
-
stackoverflow.com stackoverflow.com
-
This question was asked over a year ago, but it's a good question that I recently encountered as well...
-
-
jangawolof.org jangawolof.orgPhrases6
-
Alxemes jiy ñów la lekkool di ubbi.
C'est jeudi prochain la rentrée des classes.
alxemes -- (Arabic) Thursday.
jiy -- (?).
ñów v. -- to come, to arrive.
la -- can mean a lot of different things depending on context.
lekkool bi -- (French: l'école) school. 🏫
di v. -- be; mark of the imperfective affirmative not inactual.
ubbi v. -- open, to start, begin, inaugurate.
-
Beykat yi duñu dem tool altine.
Les cultivateurs ne vont pas au champ le lundi.
beykat bi -- farmer 👩🏾🌾 (from bey -- to farm/cultivate).
yi -- the (indicates plurality).
duñu -- do not/no one (?).
dem v. -- to go, leave, etc.
tool bi -- field, orchard.
altine ji -- (Arabic) Monday.
-
Fibar bi jàngal na taawan bu góor ni ñuy dagge reeni aloom.
Le guérisseur a appris à son fils aîné comment on coupe les racines du Diospyros.
fibar -- (fibar bi? the healer? as in feebar / fièvre / fever? -- used as a general term for sickness).
bi -- the (indicates nearness).
jàngal v. -- to teach (something to someone), to learn (something from someone) -- compare with jàng (as in janga wolof) and jàngale.
na -- pr. circ. way, defined, distant. How? 'Or' What. function indicator. As.
taaw+an (taaw) bi -- first child, eldest. (taawan -- his eldest).
bu -- the (indicates relativeness).
góor gi -- man; male.
ni -- pr. circ. way, defined, distant. How? 'Or' What. function indicator. As.
ñuy -- they (?).
dagg+e (dagg) v. -- cut; to cut.
reen+i (reen) bi -- root, taproot, support.
aloom gi -- Diospyros mespiliformis, EBENACEA (tree).
-
Dafa ànd ak moroom yi àll ba, fori aloom.
Il est allé dans la brousse ramasser des fruits de Diospyros avec ses camarades.
dafa -- he/she.
ànd v. / ànd bi -- to be together, to go together; copulate; going together, fellowship; placenta.
ak -- and, with, etc.
moroom mi -- comrade of the same age group, equal, companion, neighbor.
yi -- the (plural).
àll bi -- large expanse of uninhabited land, bush; distant, as opposed to home.
ba -- the (indicates distance).
for+i (for) v. -- to pick up.
aloom bi -- edible fruit of Diospyros mespiliformis (aloom gi for the tree).
-
Séentuwul woon ni dinañu ko alamaan.
Il ne s'attendait pas à ce qu'on lui inflige une amende.
"We didn't expect that we would be fined."
séentu+wul (séentu) v. -- to seek to see from afar 👀, to scrutinize 🧐, to expect.
woon -- he didn't (?).
ni -- formats a verb (?)
dinañu -- we will.
ko -- her, him, it.
alamaan v. -- (French: l'amende) give a fine.
-
Sama nijaay aj na ñaari yoon.
Mon oncle a effectué deux fois le pèlerinage à La Mecque.
sama -- my.
nijaay ji n. -- maternal uncle; term of reference and address to designate the husband, in conservative circles.
aj (Arabic) v. -- make the pilgrimage to Mecca. 🕋; deceased ☠️ (for a religious personality).
na -- he (?).
ñaar+i (ñaar) -- twice; two. 2️⃣
yoon wi n. -- lane, path, track 🛤; law, regulation, legislation; times.

Tags
- fellowship
- -an
- jàng
- alamaan
- school
- bu
- -e
- son
- ñuy
- how
- altine
- do
- reeni
- ba
- sickness
- male
- bush
- uncle
- into
- na
- teach
- collect
- copulate
- went
- duñu
- eldest
- land
- moroom
- dagg
- expect
- made
- she
- next
- feebar
- he
- taaw
- thursday
- taproot
- first
- yi
- yoon
- beykat
- not
- of
- alxemes
- the
- -i
- cut
- uninhabited
- ko
- equal
- comrades
- man
- lekkool
- learn
- roots
- his
- ni
- jiy
- to
- with
- companion
- fever
- monday
- dafa
- dinañu
- diospyros
- placenta
- neighbor
- distant
- comrade
- aj
- field
- janga
- what
- pick up
- ñów
- taawan
- góor
- wolof
- and
- dagge
- ebenacea
- reen
- mi
- fibar
- ànd
- tree
- dem
- as
- sama
- fièvre
- taught
- tool
- ñaari
- jàngal
- séentuwul
- farmers
- on
- ak
- my
- they
- aloom
- ubbi
- pilgrimage
- together
- mecca
- la
- fruit
- di
- healer
- gi
- twice
- woon
- child
- nijaay
- didn't
- àll
- be
- fined
- back
- bi
- mespiliformis
- fori
- for
- jàngale
- go
- support
Annotators
URL
-
-
-
Dave Rupert has a good solution that uses an input's invalid event. Instead of using the :invalid pseudo selector, he adds a CSS class to the input when it becomes invalid. We will extend this approach by removing the CSS class when the element becomes valid again.
-
-
www.html5rocks.com www.html5rocks.com
-
Validating forms has notoriously been a painful development experience. Implementing client side validation in a user friendly, developer friendly, and accessible way is hard. Before HTML5 there was no means of implementing validation natively; therefore, developers have resorted to a variety of JavaScript based solutions.
-
-
stackoverflow.com stackoverflow.com
-
I know this is old, but I got the same error and I came here from Google, so in case someone does too, this was my solution:
-
-
github.com github.com
-
markdown-it is the result of the decision of the authors who contributed to 99% of the Remarkable code to move to a project with the same authorship but new leadership (Vitaly and Alex). It's not a fork.
-
-
www.kickstarter.com www.kickstarter.com
-
Try before you buy Here's a link to the game on Tabletopia: Judean Hammer on Tabletopia
-
-
stackoverflow.com stackoverflow.com
-
I realize the question was asked 9 years ago, but this question is (still) ranked highly in search results and I came across it today
-
-
distributed.press distributed.press
-
<small><cite class='h-cite via'>ᔥ <span class='p-author h-card'>petermolnar</span> in #indieweb 2021-03-08 (<time class='dt-published'>03/08/2021 10:06:29</time>)</cite></small>
-
-
www.kickstarter.com www.kickstarter.com
-
If you want to try playing to see how these pieces work in the game, you can playtest it on the Iishogi.org site (https://lishogi.org/). Last year the Iishogi designer asked me to register the Design SHOGI pieces on their site. This Iishogi.org is a free to play Shogi website. I was willing to give them permission to use them. You are free to play and switch pieces design from the piece variation section. If you register your ID, then you can play vs the A.I. easily. You can learn how the Design SHOGI pieces work there.
-
-
www.digitalocean.com www.digitalocean.com
-
Wire this up for Brennan's website, so that I can protect the upload portal.
-
-
www.youtube.com www.youtube.com
-
-
openwindows.ace.fordham.edu openwindows.ace.fordham.edu
-
<small><cite class='h-cite via'>ᔥ <span class='p-author h-card'>AG Wilsonn</span> in hungry bread elevator {αἱματόϊδρις} on Twitter: "In undergrad graded classrooms 95% of the unprompted questions are about assignments/exams (grades) so the trick is to design your assignments in such a way that when students ask about them they are actually asking about the course material too. anybody know how to do this?" / Twitter (<time class='dt-published'>03/04/2021 20:50:53</time>)</cite></small>
-
-
www.nytimes.com www.nytimes.com
-
This is the story of how a bill to save the vote and preserve a semblance of democracy for millions of Americans died at the hands of an intransigent, reactionary minority in the Senate, which used the filibuster to do its dirty work
The author starts off by personifying "the bill" as something that was supposed to save millions of Americans, but rather was killed by Senators. He immediately provides a brief overview of the claim of his essay before developing his narrative. This way, the audience gets a glimpse of the issue that the author will tackle. Also, by using words such as "intransigent and reactionary", the audience already understands that the author is going to be criticizing the senators for their action.
-
-
twitter.com twitter.com
-
ReconfigBehSci on Twitter. (n.d.). Twitter. Retrieved 5 March 2021, from https://twitter.com/SciBeh/status/1326159560835555328
-
-
github.com github.com
-
It can also be included as individual modules, i.e. Hashie::Extensions::MethodReader, Hashie::Extensions::MethodWriter and Hashie::Extensions::MethodQuery.
-
-
eprint.iacr.org eprint.iacr.org
-
Not that I have any hope of understanding it, but . . .
-
-
www.lavenderandlovage.com www.lavenderandlovage.com
-
trailblazer.to trailblazer.to
-
It is much easier to track what is going on within the activity. Instead of transporting additional state via ctx, you expose the outcome via an additional end event.
Note: It's only super easy to see what's going on if you have the benefit of a diagram.
-
This is my absolute favorite feature ever and the official reason for (re-)writing Trailblazer 2.1. It makes me happy every time I use it.
-
So why the over-complication? What we got now is replicating a chain of && in the former version. This time, however, you will know which condition failed and what went in by using tracing. Look at the trace above - it’s impossible to not understand what was going on.
-
Hey, that’s is an imaginary complication of our example - please don’t do this with every condition you have in your app.
Tags
- easy to understand
- state management
- extremes
- answer the "why?"
- coming up with hypothetical examples
- funny
- example: not how you would actually do it (does something wrong/bad/nonideal illustrating but we should overlook it because that's not the one thing the example is trying to illustrate/show us)
- why?
- artificial example
- easy to see/notice
- favorite
- pleasant/enjoyable to use
- debugging tools
- easy to follow/read/understand
Annotators
URL
-
-
Local file Local file
-
.The firstparadigm centres on institutional power: ‘Our schools, our government, our businessesand corporations are permeated with the view that neither individual nor group aretrustworthy. There must be power over, power to control. This hierarchal system isinherent in our whole culture’. The second paradigm takes the opposite view: ‘Givena suitable climate, humankind is trustworthy, creative, self-motivated, powerful andconstructive – capable of releasing undreamed-of-potentialities’
there is an ongoing struggle in many areas of society, in schools, workplaces, religious organisations. the second paradigm doesn't seem to win over the first on a large scale, since significant change in any domain is a frustrating and never-ending process.
-
importedfrom the business and commercial world.
who decided this? who decides which measures of success are appropriate?
-
target driven climate which has the potential to undermine theimportance of ‘relationship
taking away from the very purpose of the practice
-
-
psyarxiv.com psyarxiv.com
-
Oljača, M., Sadiković, S., Branovacki, B., Pajić, D., Smederevac, S., & Mitrović, D. (2020). Unrealistic optimism and HEXACO traits as predictors of risk perception and compliance with COVID-19 preventive measures during the first wave of pandemic. PsyArXiv. https://doi.org/10.31234/osf.io/rt64j
-
-
seirdy.one seirdy.one
-
en.wikipedia.org en.wikipedia.org
Tags
Annotators
URL
-
-
trailblazer.to trailblazer.to
-
patch: -> { step Destroy.method(:tidy_storage), before: :delete_model }
-
- Feb 2021
-
www.theguardian.com www.theguardian.com
-
Hern, Alex. ‘“Eat out to Help out” May Have Caused Sixth of Covid Clusters over Summer’. The Guardian, 30 October 2020, sec. Business. https://www.theguardian.com/business/2020/oct/30/treasury-rejects-theory-eat-out-to-help-out-caused-rise-in-covid.
-
-
github.com github.com
-
URI::MailTo::EMAIL_REGEXP
First time I've seen someone create a validator by simply matching against
URI::MailTo::EMAIL_REGEXPfrom std lib. More often you see people copying and pasting some really long regex that they don't understand and is probably not loose enough. It's much better, though, to simply reuse a standard one from a library — by reference, rather than copying and pasting!!
-
-
netflixtechblog.com netflixtechblog.com
Tags
Annotators
URL
-
-
github.com github.com
-
Since we're not passing any inputs to ListAccounts, it makes sense to use .run! instead of .run. If it failed, that would mean we probably messed up writing the interaction.
-
ActiveModel provides a powerful framework for defining callbacks. ActiveInteraction hooks into that framework to allow hooking into various parts of an interaction's lifecycle.
-
It requires an account to update, but the other inputs are optional. If they're missing, it'll ignore those attributes. If they're present, it'll update them.
-
If ActiveModel deals with your nouns, then ActiveInteraction handles your verbs.
It's a good analogy, but I think it's misleading/confusing/unclear/incorrect, because parts of ActiveInteraction are ActiveModel, so I guess ActiveInteraction deals with your nouns too?
-
For this one we'll define a helper method to handle raising the correct errors. We have to do this because calling .run! would raise an ActiveInteraction::InvalidInteractionError instead of an ActiveRecord::RecordNotFound. That means Rails would render a 500 instead of a 404.
True, but why couldn't it handle this for us?
Tags
- leverage library/tool to do something for you
- see content below
- library/framework should provide this (standard solution) rather than everyone having to write their own slightly different solution (even if it is easy enough to write yourself)
- elegant solution
- makes sense to me
- misleading
- good point
- better to run into errors in development so you catch them as soon as possible before they reach production
- confusing
- ActiveModel
- _ is to _ (analogy)
- good analogy
- unclear
- fail fast
Annotators
URL
-
-
trailblazer.to trailblazer.to
-
For branching out a separate path in an activity, use the Path() macro. It’s a convenient, simple way to declare alternative routes
Seems like this would be a very common need: once you switch to a custom failure track, you want it to stay on that track until the end!!!
The problem is that in a Railway, everything automatically has 2 outputs. But we really only need one (which is exactly what Path gives us). And you end up fighting the defaults when there are the automatic 2 outputs, because you have to remember to explicitly/verbosely redirect all of those outputs or they may end up going somewhere you don't want them to go.
The default behavior of everything going to the next defined step is not helpful for doing that, and in fact is quite frustrating because you don't want unrelated steps to accidentally end up on one of the tasks in your custom failure track.
And you can't use
failfor custom-track steps becase that breaksmagnetic_tofor some reason.I was finding myself very in need of something like this, and was about to write my own DSL, but then I discovered this. I still think it needs a better DSL than this, but at least they provided a way to do this. Much needed.
For this example, I might write something like this:
step :decide_type, Output(Activity::Left, :credit_card) => Track(:with_credit_card) # Create the track, which would automatically create an implicit End with the same id. Track(:with_credit_card) do step :authorize step :charge endI guess that's not much different than theirs. Main improvement is it avoids ugly need to specify end_id/end_task.
But that wouldn't actually be enough either in this example, because you would actually want to have a failure track there and a path doesn't have one ... so it sounds like Subprocess and a new self-contained ProcessCreditCard Railway would be the best solution for this particular example... Subprocess is the ultimate in flexibility and gives us all the flexibility we need)
But what if you had a path that you needed to direct to from 2 different tasks' outputs?
Example: I came up with this, but it takes a lot of effort to keep my custom path/track hidden/"isolated" and prevent other tasks from automatically/implicitly going into those steps:
class Example::ValidationErrorTrack < Trailblazer::Activity::Railway step :validate_model, Output(:failure) => Track(:validation_error) step :save, Output(:failure) => Track(:validation_error) # Can't use fail here or the magnetic_to won't work and Track(:validation_error) won't work step :log_validation_error, magnetic_to: :validation_error, Output(:success) => End(:validation_error), Output(:failure) => End(:validation_error) endputs Trailblazer::Developer.render o Reloading... #<Start/:default> {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model> #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model> {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error> {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=save> #<Trailblazer::Activity::TaskBuilder::Task user_proc=save> {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error> {Trailblazer::Activity::Right} => #<End/:success> #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error> {Trailblazer::Activity::Left} => #<End/:validation_error> {Trailblazer::Activity::Right} => #<End/:validation_error> #<End/:success> #<End/:validation_error> #<End/:failure>Now attempt to do it with Path... Does the Path() have an ID we can reference? Or maybe we just keep a reference to the object and use it directly in 2 different places?
class Example::ValidationErrorTrack::VPathHelper1 < Trailblazer::Activity::Railway validation_error_path = Path(end_id: "End.validation_error", end_task: End(:validation_error)) do step :log_validation_error end step :validate_model, Output(:failure) => validation_error_path step :save, Output(:failure) => validation_error_path endo=Example::ValidationErrorTrack::VPathHelper1; puts Trailblazer::Developer.render o Reloading... #<Start/:default> {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model> #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model> {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error> {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=save> #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error> {Trailblazer::Activity::Right} => #<End/:validation_error> #<Trailblazer::Activity::TaskBuilder::Task user_proc=save> {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error> {Trailblazer::Activity::Right} => #<End/:success> #<End/:success> #<End/:validation_error> #<End/:failure>It's just too bad that:
- there's not a Railway helper in case you want multiple outputs, though we could probably create one pretty easily using Path as our template
- we can't "inline" a separate Railway acitivity (Subprocess "nests" it rather than "inlines")
-
Subprocess will try to match the nested ends’ semantics to the tracks it knows. You may wire custom ends using Output.
-
step :direct_debit
I don't think we would/should really want to make this the "success" (Right) path and :credit_card be the "failure" (Left) track.
Maybe it's okay to repurpose Left and Right for something other than failure/success ... but only if we can actually change the default semantic of those signals/outputs. Is that possible? Maybe there's a way to override or delete the default outputs?
-
Patching has no implicit, magical side-effects and is strongly encouraged to customize flows for a specific case in a quick and consise way.
-
However, it can be a PITA if you want to customize one of those deeply nested components and add or remove a certain step, for example.
-
While you could nest an activity into another manually, the Subprocess macro will come in handy.
-
The macro automatically wires all of Validate’s ends to the known counter-part tracks.
-
Since notify sits on the “failure” track and hence is “magnetic to” :failure, find_provider will be connected to it.
-
This connects the failure output to the previous task, which might create an infinity loop and waste your computing time - it is solely here for demonstrational purposes.
Tags
- useful
- good abstraction
- verbose / noisy / too much boilerplate
- concise
- nice API
- trailblazer-activity
- example: in order to keep example concise/focused, may not implement all best practices (illustrates one thing only)
- semantics
- I have a question about this
- official preferred convention / way to do something
- extension API: patching
- side effects
- customizable
- feels wrong
- no magic
- flexibility
- powerful
- automatic
- monkey patching
- makes sense to me
- tip
- helper functions
- example: not how you would actually do it (does something wrong/bad/nonideal illustrating but we should overlook it because that's not the one thing the example is trying to illustrate/show us)
- leverage library/tool to do something for you
- extension API: ability to override/customize nested objects
- macro
Annotators
URL
-
-
eprints.lse.ac.uk eprints.lse.ac.uk
-
<small><cite class='h-cite via'>ᔥ <span class='p-author h-card'>Christopher Ingraham</span> in ‘Trickle-down’ economics doesn’t work, according to comprehensive new research - The Washington Post (<time class='dt-published'>02/25/2021 12:36:59</time>)</cite></small>
-
-
science.thewire.in science.thewire.in
-
onezero.medium.com onezero.medium.com
-
<small><cite class='h-cite via'>ᔥ <span class='p-author h-card'>Cory Doctorow</span> in Pluralistic: 16 Feb 2021 – Pluralistic: Daily links (<time class='dt-published'>02/25/2021 12:20:24</time>)</cite></small>
It's interesting to note that there are already two other people who have used Hypothes and their page note functionality to tag this article as to read, one with
(to read)and another with(TODO-read).
-
-
www.youtube.com www.youtube.com
-
<small><cite class='h-cite via'>ᔥ <span class='p-author h-card'>Cory Doctorow</span> in Pluralistic: 16 Feb 2021 – Pluralistic: Daily links from Cory Doctorow (<time class='dt-published'>02/25/2021 12:20:24</time>)</cite></small>
-
-
chicinacademia.com chicinacademia.com
-
Chic in Academia. ‘Science Says Sunday – How to Spot Misinformation’, 20 December 2020. https://chicinacademia.com/2020/12/20/science-says-sunday-how-to-spot-misinformation/.
-
-
psyarxiv.com psyarxiv.com
-
Długosz, Piotr. ‘PREDICTORS OF PSYCHOLOGICAL STRESS OCCURRING AFTER THE FIRST WAVE OF THE COVID-19 PANDEMIC IN POLAND’. PsyArXiv, 24 February 2021. https://doi.org/10.31234/osf.io/2k8px.
-
-
queue.acm.org queue.acm.org
-
how to track on-call coverage
-
-
github.com github.com
-
Personally, I'm starting to think that the feature where it automatically adds xray.js to the document is more trouble than it's worth. I propose that we remove that automatic feature and just make it part of the install instructions that you need to add this line to your template/layout: <%= javascript_include_tag 'xray', nonce: true if Rails.env.development? %>
-
-
github.com github.com
-
Now that I've thought more about it, I honestly think the auto-adding the script feature is overrated, over-complicated, and error-prone (#98, #100), and I propose we just remove it (#110).
-
-
github.com github.com
-
now that I've thought more about it, I think the auto-adding the script feature is overrated, over-complicated, and error-prone (#100), and ought to just be removed (#110).
-
-
github.com github.com
-
now that I realize how easy it is to just manually include this in my app: <%= javascript_include_tag 'xray', nonce: true if Rails.env.development? %> I regret even wasting my time getting it to automatically look for and add a nonce to the auto-injected xray.js script
Tags
- wasted effort
- removing features to simplify implementation
- fix design/API mistakes as early as you can (since it will be more difficult to correct it and make a breaking change later)
- removing feature that is more trouble than it's worth (not worth the effort to continue to maintain / fix bugs caused by keeping it)
- removing legacy/deprecated things
- regret
Annotators
URL
-
-
misinforeview.hks.harvard.edu misinforeview.hks.harvard.edu
Tags
Annotators
URL
-
-
psyarxiv.com psyarxiv.com
-
Schwartz, K. D., Cortens, D. E., McMorris, C., Makarenko, E., Arnold, P., Van Bavel, M., … Canfield, R. (2020, December 15). COVID-19 and Student Well-being: Stress and Mental Health during Return-to-School. https://doi.org/10.31234/osf.io/mqpvn
-
-
sass-lang.com sass-lang.com
-
Sass variables, like all Sass identifiers, treat hyphens and underscores as identical. This means that $font-size and $font_size both refer to the same variable. This is a historical holdover from the very early days of Sass, when it only allowed underscores in identifier names. Once Sass added support for hyphens to match CSS’s syntax, the two were made equivalent to make migration easier.
-
-
github.com github.com
-
As a workaround, I guess I'll have to disable my strict CSP in development, but I'd prefer to keep it strict in development as well so that I ran into any CSP issues sooner...
-
-
github.com github.com
-
Keeping bootstrap-sass in sync with upstream changes from Bootstrap used to be an error prone and time consuming manual process. With Bootstrap 3 we have introduced a converter that automates this.
-
-
github.com github.com
-
It's recommended to configure this library by setting environment variables.
-
-
guides.rubyonrails.org guides.rubyonrails.org
-
Keep in mind that third party code with references to other files also processed by the asset Pipeline (images, stylesheets, etc.), will need to be rewritten to use helpers like asset_path.
-
-
github.com github.com
-
Here's the last issue where source maps were discussed before the beta release.
-
How do you know if source maps are working correctly? Try adding a syntax error to one of your assets and use the console to debug. Does it show the correct file and source location? Or does it reference the top level application.js file?
-
Your Rails app Gemfile may have a line requiring sass-rails 5.0: gem 'sass-rails', '~> 5.0' # or gem 'sass-rails', '~> 5' These will prevent upgrade to sprockets 4, if you'd like to upgrade to sprockets 4 change to: gem 'sass-rails', '>= 5'
Tags
- how to check/verify/test whether something is working
- Gemfile: version constraints
- test plan / how to test (software development)
- dependencies: locking to specific version
- allowing sufficient time for discussion/feedback/debate before a final decision is made
- link to what you are referring to
- have discussion/feedback/debate in public (transparency)
Annotators
URL
-
-
www.schneems.com www.schneems.com
-
That’s it. If you have a previous “precompile” array, in your app config, it will continue to work. For continuity sake I recommend moving over those declarations to your manifest.js file so that it will be consistent.
-
That’s pretty gnarly. While the name of the constant LOOSE_APP_ASSETS gives me some idea of what it does, it still takes a second to wrap your mind around. If you were trying to figure out what assets are being precompiled and you did a puts config.assets.precompile that lambda object would be utterly baffling.
-
-
cherrycreekschools.instructure.com cherrycreekschools.instructure.com
-
Did the district just not see the problem with taking away some schools busing?
-
I thought that these numbers where really interesting, especially when the Hispanic enrollments increased
Tags
- Without waiting for judicial approval, the board pulled nineelementary schools out of the busing program this summer, reducing to 10 percent thenumber of students being bused.
- In 1968, the year before busing began, 63,398 white students attended Denver publicschools. Last year, there were 18,000. Black enrollments have remained about 13,000, whileHispanic enrollments have increased to 28,283 from 18,611.
Annotators
URL
-
-
trailblazer.to trailblazer.to
-
Yes, we could and should use Reform or Dry-validation here.
-
provide interfaces so you don’t have to think about them
Question to myself: Is not having to think about it actually a good goal to have? Is it at odds with making intentional/well-considered decisions?  Obviously there are still many of interesting decisions to make even when using a framework that provides conventions and standardization and makes some decisions for you...
Tags
- standardization
- software design patterns
- framework
- example: in order to keep example concise/focused, may not implement all best practices (illustrates one thing only)
- interfaces (programming)
- I have a question about this
- so you don’t have to think about it
- intentional/well-considered decisions
Annotators
URL
-
-
en.wikipedia.org en.wikipedia.org
-
found that using only the Pascal-provided control structures, the correct solution was given by only 20% of the subjects, while no subject wrote incorrect code for this problem if allowed to write a return from the middle of a loop.
-
computers theoretically need only one machine instruction (subtract one number from another and branch if the result is negative)
-
-
sobolevn.me sobolevn.me
-
Now you can easily spot them! The rule is: if you see a Result it means that this function can throw an exception. And you even know its type in advance.
-
we also wrap them in Failure to solve the second problem: spotting potential exceptions is hard
-
Not all cases can be covered and easily restored. And sometimes when we will reuse this function for different use-cases we will find out that it requires different restore logic.
-
But why do we return 0? Why not 1? Why not None? And while None in most cases is as bad (or even worse) than the exceptions, turns out we should heavily rely on business logic and use-cases of this function.
-
Almost everything in python can fail with different types of exceptions: division, function calls, int, str, generators, iterables in for loops, attribute access, key access, even raise something() itself may fail. I am not even covering IO operations here. And checked exceptions won’t be supported in the nearest future.
-
You still need to have a solid experience to spot these potential problems in a perfectly readable and typed code.
-
print will never be actually executed. Because 1 / 0 is an impossible operation and ZeroDivisionError will be raised.
-
So, the sad conclusion is: all problems must be resolved individually depending on a specific usage context. There’s no silver bullet to resolve all ZeroDivisionErrors once and for all. And again, I am not even covering complex IO flows with retry policies and expotential timeouts.
Tags
- easy to miss / not notice (attention)
- depends on use case / application
- anticipating what could go wrong / error/exception cases
- type checking
- why?
- the specific context is important
- error/exception handling: spotting potential exceptions is hard
- railway-oriented programming
- actually consider / think about how it _should_ (ideally) be
- rule of thumb
- monad: Either
- difficult/hard problem
- can't think of everything
- sad/unfortunate conclusion
- error/exception handling
- the benefit of experience
- easy to see/notice
- type annotations
- need to solve specific case/problems individually (there is no general solution)
Annotators
URL
-
-
en.wikipedia.org en.wikipedia.org
-
despite initially appearing to be an appropriate and effective response to a problem, has more bad consequences than good ones
-
-
-
I'm not a fan of listing exceptions functions can throw, especially here in Python, where it's easier to ask forgiveness than permission.
-
certainly I wouldn't want it to start telling me that I'm not catching these!
Tags
- errors/warnings that may not apply to your case and be noisy/annoying to be warned about
- programming languages: requires verbosity / extra paperwork to explicitly list types/exceptions/...
- checked exceptions
- Python: the Python way
- error/exception handling
- easier to ask forgiveness than permission
Annotators
URL
-
-
github.com github.com
-
Enforces better architecture
-
-
www.kickstarter.com www.kickstarter.comDEFCON 11
-
The author will offer presentation/game sessions on Tabletopia, in French and English. In addition, the game will be freely available for players on Tabletopia as soon as the written rules are available.
-
-
www.metacritic.com www.metacritic.com
-
This tedium would be unacceptable in an action game, but Windbound is a survival game. In survival games, death is supposed to mean something. Loss of progress represents the stakes; repetition is the barrier of entry.
-
-
www.morozov.is www.morozov.is
-
Do notation provides an alternative to bind, which also flattens the code.
-
However, you don’t need to have an extensive knowledge of monads to use ROP in your code.
-
-
en.wikipedia.org en.wikipedia.org
-
For historical reasons, this map is instead called fmap in Haskell.
-
-
dry-rb.org dry-rb.org
-
In other words, once you've used Maybe you cannot hit nil with a missing method. This is remarkable because even &. doesn't save you from omitting || "No state" at the end of the computation. Basically, that's what they call "Type Safety".
-
It's hard to say why people think so because you certainly don't need to know category theory for using them, just like you don't need it for, say, using functions.
-
-
jrsinclair.com jrsinclair.com
-
As you can see, we end up with a lot of boilerplate if-statements. The code is more verbose. And it’s difficult to follow the main logic.
-
Don’t worry if you get confused at first. Everyone does. I’ve listed some other references at the end that may help. But don’t give up.
-
-
mmhaskell.com mmhaskell.com
-
So if you don't yet understand functors or applicative functors, check out part 1 and part 2 of this series!
-
-
-
fsharpforfunandprofit.com fsharpforfunandprofit.com
-
This is a useful approach to error handling, but please don’t take it to extremes! See my post on “Against Railway-Oriented Programming”.
-
-
fsharp.org fsharp.org
Tags
Annotators
URL
-
-
trailblazer.to trailblazer.to
-
Feel free to pick and choose what you need for your applications.
-
-
en.wikipedia.org en.wikipedia.org
-
Software architecture is about making fundamental structural choices that are costly to change once implemented.
-
-
www.huffpost.com www.huffpost.com
-
They do not maintain a to-do list (mentally or physically).
-
If you ask my former students, they will tell you that as a teacher, my goal is to do nothing. I dream of the day when I can sit at my desk, feet propped up, reading a book, while the classroom bursts with activity and learning around me.
-
-
-
en.wikipedia.org en.wikipedia.org
-
-
-
In the short term you may have the stamina to get up earlier, stay later, and out-work the demands you face. But the inverse equation of shrinking resources and increasing demands will eventually catch up to you, and at that point how you involve others sets the ceiling of your leadership impact.
-
-
trailblazer.to trailblazer.to
-
The legendary cfp-app will become a Rails-to-TRB refactoring tutorial.
-
And yes, at TRB GmbH, we do pay people to work on OSS
-
The new 2.1 version comes with a few necessary but reasonable changes in method signatures. As painful as that might sound to your Rails-spoiled ears, we preferred to fix design mistakes now before dragging them on forever.
-
The new call API is much more consistent and takes away another thing we kept explaining to new users - an indicator for a flawed API.
-
It’s so simple that I sometimes wonder why it took years to develop it!
Tags
- pointing out gaps/downsides/cons in competition/alternatives
- Rails app
- getting paid to work on open-source software
- very simple/small result/change in the end but took a lot of work/time to arrive there
- refactoring
- Trailblazer
- better late than never
- example/demo app
- rails
- fix design/API mistakes as early as you can (since it will be more difficult to correct it and make a breaking change later)
- switching/migrating to something different
- if it's incorrect; fix it
- learn from your mistakes
- job: benefits
- do it right/well the first time because it may be too hard to clean up/fix later if you don't
Annotators
URL
-
-
2019.trailblazer.to 2019.trailblazer.to
-
note that TRB source code modifications are not proprietary
In other words, you can build on this software in your proprietary software but can't change the Trailblazer source unless you're willing to contribute it back.
loophole: I wonder if this will actually just push people to move their code -- which at the core is/would be a direction modification to the source code - out to a separate module. That's so easy to do with Ruby, so this restriction hardly seems like it would have any effect on encouraging contributions.
Tags
- neutral/dispassionate/impartial/objective wording
- proprietary software
- reminder
- well-written
- good point
- open-source software: not contributing new code back to project
- LGPL
- software licensing
- annotation meta: may need new tag
- wording designed to be more palatable/pleasing/inoffensive
- loophole/escape hatch
Annotators
URL
-
-
github.com github.com
-
The bare bones operation without any Trailblazery is implemented in the trailblazer-operation gem and can be used without our stack.
-
While Trailblazer offers you abstraction layers for all aspects of Ruby On Rails, it does not missionize you. Wherever you want, you may fall back to the "Rails Way" with fat models, monolithic controllers, global helpers, etc. This is not a bad thing, but allows you to step-wise introduce Trailblazer's encapsulation in your app without having to rewrite it.
-
Only use what you like.
-
you can pick which layers you want. Trailblazer doesn't impose technical implementations
Tags
- focus on what it should do, not on how it should do it (implementation details; software design)
- making changes / switching/migrating gradually/incrementally/step-wise/iteratively
- trailblazer-operation
- leaving the details of implementation/integration up to you
- rails: the Rails way
- allowing developer/user to pick and choose which pieces to use (allowing use with competing libraries; not being too opinionated; not forcing recommended way on you)
- Trailblazer
- abstractions
- newer/better ways of doing things
- freedom of user to override specific decision of an authority/vendor (software)
- focus on concepts/design/structure instead of specific/concrete technology/implementation
Annotators
URL
-
-
psyarxiv.com psyarxiv.com
-
Sun, R., Rieble, C., Liu, Y., & Sauter, D. (2020). Connected Despite COVID-19: The Role of Social Interactions and Social Media for Wellbeing. PsyArXiv. https://doi.org/10.31234/osf.io/x5k8u
-
-
stackoverflow.com stackoverflow.com
-
# catch multi-char special key sequences read -sN1 -t 0.0001 k1 read -sN1 -t 0.0001 k2 read -sN1 -t 0.0001 k3 key+=${k1}${k2}${k3}
-
-
linusakesson.net linusakesson.net
-
Beware, though: What you are about to see is not particularly elegant. In fact, the TTY subsystem — while quite functional from a user's point of view — is a twisty little mess of special cases. To understand how this came to be, we have to go back in time.
-
-
stackoverflow.com stackoverflow.com
-
However, banning him opens a very dangerous precedent, making the US more like a dictatorship... more like China. Also it's not effective. Those who were silenced will only have more motivation, and the risk of terrorism is greatly increased. The people must decide what is true. Not big companies. Individuals must be able to express their beliefs. Bot accounts must be banned, but real individuals must not. If you think a group of people is a bunch of idiots who believe fake news, then, tough, that's democracy for you. Maybe it means that your government is not investing enough in education and welfare to properly educate and give hope to those people.
-
I oppose the banning of Donald Trump and his non-violent believers/content from social media platforms such as Facebook Twitter, YouTube and Amazon. I feel (irrationally?) Trump is arrogant and disgusting as a person. I like some of his anti-CCP policies, but not sure I'd vote for him. The "USA First" stance is particularly damaging as it scares USA allies away. I don't think there's enough evidence for the electoral fraud allegations, but I haven't researched the court cases extensively. However, banning him opens a very dangerous precedent, making the US more like a dictatorship... more like China. Also it's not effective. Those who were silenced will only have more motivation, and the risk of terrorism is greatly increased. The people must decide what is true. Not big companies. Individuals must be able to express their beliefs. Bot accounts must be banned, but real individuals must not. If you think a group of people is a bunch of idiots who believe fake news, then, tough, that's democracy for you. Maybe it means that your government is not investing enough in education and welfare to properly educate and give hope to those people. I'm against violence.
-
-
www.cnbc.com www.cnbc.com
-
AWS can even terminate or suspend its agreement with a customer immediately under certain circumstances as it did in 2010 with Wikileaks, pointing to violations of AWS’ terms of service.
-
The swiftness with which Amazon acted shouldn’t come as a shock. Companies have been disclosing details about their deals with Amazon that warn of these kinds of sudden discontinuations for years.
-
The incident demonstrates a type of power that Amazon wields almost uniquely because so many companies rely on it to deliver computing and data storage.
-
-
www.metacritic.com www.metacritic.com
-
i dont know why everyone wants to **** on everything that is not a "AAA" game, its not in its perfect state, but far from deserve a 3, i will give it a 9 so it counters the "just hate
-
-
every.to every.to
-
Personal todo lists don’t depend on others using the same system (no network effects)
They don't unless you're building a wiki or commonplace book that can interact with those of others. (Roam research isn't doing this---yet, but they should.) Ideally small building block pieces will allow it to dovetail with other systems that could potentially do the same thing.
-
-
-
{a: 1, b: 2, c: 3, d: 4} => {a:, b:, **rest} # a == 1, b == 2, rest == {:c=>3, :d=>4}
equivalent in javascript:
{a, b, ...rest} = {a: 1, b: 2, c: 3, d: 4}Not a bad replacement for that! I still find javascript's syntax a little more easily readable and natural, but given that we can't use the same syntax (probably because it would be incompatible with existing syntax rules that we can't break for compatibility reasons, unfortunately), this is a pretty good compromise/solution that they've come up with.
-
-
github.com github.com
-
Nevermind, I use now reform-rails
-
@adisos if reform-rails will not match, I suggest to use: https://github.com/orgsync/active_interaction I've switched to it after reform-rails as it was not fully detached from the activerecord, code is a bit hacky and complex to modify, and in overall reform not so flexible as active_interaction. It has multiple params as well: https://github.com/orgsync/active_interaction/blob/master/spec/active_interaction/modules/input_processor_spec.rb#L41
I'm not sure what he meant by:
fully detached from the activerecord I didn't think it was tied to ActiveRecord.
But I definitely agree with:
code is a bit hacky and complex to modify
Tags
- active_interaction
- flexibility
- I agree
- too coupled/dependent
- pointing out gaps/downsides/cons in competition/alternatives
- recommended option/alternative
- recommended software
- missed opportunity
- hard to understand
- reform (Ruby)
- evaluating software options
- too complicated
- switching/migrating to something different
Annotators
URL
-
-
github.com github.com
-
Any idea @AaronLasseigne if this is mergeable?
-
This is a breaking change so it'll have to go into a major release. I was working on a v4 release but it's too much. I think I'm going to pair it back and we can add this to the new v4. When I have that ready, I'll rebase the merge onto that branch.
Tags
- don't let big plans/goals get in the way of integrating/releasing smaller changes/improvements
- waiting for maintainers to review / merge pull request / give feedback
- releases: how much to include in a release / when to defer a change until next release
- why has this not been merged yet?
- breaking change
Annotators
URL
-
-
github.com github.com
-
No one has requested it before so it's certainly not something we're planning to add.
-
To give a little more context, structures like this often come up in my work when dealing with NoSQL datastores, especially ones that rely heavily on JSON, like Firebase, where a records unique ID isn't part of the record itself, just a key that points to it. I think most Ruby/Rails projects tend towards use cases where these sort of datastores aren't appropriate/necessary, so it makes sense that this wouldn't come up as quickly as other structures.
-
Thanks, I'll continue leaning on the array workaround for my use case then.
-
-
github.com github.com
-
I don't think seeing it in Rails PRs naturally means we should do it blankly. Put it another way, what's the justification in those PRs for doing it?
-
The main realization came when I figured out that the main_model was just another association. This means we can move a lot of logic to just that class and reason about it a lot better.
Tags
- realization
- investing time to really understand something
- understand both sides of an issue
- it's just _
- why?
- fallacy: doing something because it's popular / everyone is doing it
- easy to reason about
- special cases
- rationale
- doing something without knowing why/how it works
- solving/handling the general case
- understand the ramifications/effects/consequences
- justification for existence
- understand the trade-offs
Annotators
URL
-
-
railscasts.com railscasts.com
-
So how are we going to create a model that doesn’t have a database table behind it? There are several potential solutions including various plugins but we’re going to use the method described in an entry on the Code Tunes blog. This shows a techinque that involves overriding a couple of methods in an ActiveRecord model and then manually defining the columns in the model file rather than in the database table. In our Recommendation model we’ll add in the two overridden methods and then use the column class method to define the columns in a similar way to how they’re defined in a migration file.
Does this still work in Rails 6? I wonder.
-
-
github.com github.com
-
Examples of different ways of defining forms
Wow, that's a lot of different ways.
The inline_form way in particular seems interesting to me, though it's worth noting that that method is just an example, not actually part of this project's code, so it's not really a first-class option like the other options.
-
Bureaucrat doesn't define save
It's probably just as well, since it will almost always need to be overridden with custom logic...
-
-
github.com github.com
-
The assert method is used by all the other assertions. It pushes the second parameter to the list of errors if the first parameter evaluates to false or nil.
Seems like these helper functions could be just as easily used in ActiveRecord models. Therefore, they should be in a separate gem, or at least module, that can be used in both these objects and ActiveRecord objects.
-
-
en.wikipedia.org en.wikipedia.org
-
For the usage in society, see Second-class citizen.
Ironic that this reference is ostensibly about the usage of "first-class citizen" in society, yet it links to a seemingly-mismatched (by name only, that is) article, entitled "second-class citizen".
Ironic that the first-class (unqualified) article is about the figurative meaning of "citizen" used in computer science, and that the page describing first-class and second-class status of the more literal citizens in society is relegated to what I kind of think is a second-class position in the encyclopedia (because it takes the #2 position numerically, even though it is (at least as is implied in this reference) also about first-class citizens (though the word "first-class" does not appear a single time in that article, so maybe this reference is the one that is more ironic/incorrect).
-
-
github.com github.com
-
Set your models free from the accepts_nested_attributes_for helper. Action Form provides an object-oriented approach to represent your forms by building a form object, rather than relying on Active Record internals for doing this.
It seems that the primary/only goal/purpose was to provide a better alternative to ActiveRecord's accepts_nested_attributes_for.
Unfortunately, this appears to be abandoned.
-
-
github.com github.com
-
Take 3, Previously attempted in 2012 (#8189) and 2015 (#19709). This new version uses ActiveModel Attributes API.
-
-
github.com github.com
-
We are still open to the idea but the implementation should leverage the attributes API introduced in Rails 5.2 in Active Model.
-
Fork rails, add github.com/georgebrock/rails as a remote, merge this branch into rails/4.0.2 (the tag), and then use your fork of Rails: gem 'rails', github: 'yourusername/rails'
-
If you take it to it's logical conclusion you'd only accept the correct types for boolean, integer, decimal, etc. columns, which is obviously crazy.
-