Re: [Rails-core] Proposal to run spell check on GItHub Actions

2019-10-29 Thread Dana Sherson
Hi friends, in case it's relevant, i've recently built a source-code 
focused spell checker in ruby https://github.com/robotdana/spellr designed 
to be part of CI pipelines

On Tuesday, October 29, 2019 at 6:03:27 PM UTC+11, Masafumi Okura wrote:
>
> Hi Richard,
>
> I understand your concern. I'm not really familiar with spell checking on 
> technical documents, so I'd like to stop this discussion here. If I get 
> more familiar with how to introduce informational spell checker, I'll come 
> to give a proposal again.
>
> On Monday, October 28, 2019 at 3:43:52 AM UTC+9, richard schneeman wrote:
>>
>> As someone who has commit to the project merging in spelling corrections 
>> takes almost no time. I don't think getting fewer of these PRs would be a 
>> huge net win (others with commit might disagree). As an occasional writer 
>> of features and docs, it would be nice to get feedback right away that I 
>> had made an error, but I find spell checking for technical documentation to 
>> be very error-prone. I usually turn it off for my editors due to the sheer 
>> volume of false spelling flags. If we did adopt some kind of a spell 
>> checker I would want it to be more for information purposes than as a hard 
>> blocker. If the accuracy looks good then we could eventually make it 
>> mandatory.
>>
>>
>> On Sun, Oct 27, 2019 at 9:20 AM Masafumi Okura  
>> wrote:
>>
>>> Hi,
>>>
>>> This is a proposal related to
>>>  https://groups.google.com/d/msg/rubyonrails-core/o3wWBsTSbxU/s9X6pJHDBwAJ 
>>> 
>>>
>>> I see many Pull Requests fixing typos in documents. This can be done 
>>> mostly automatically by machines.
>>> I found there's a good tool to find misspells. 
>>> https://github.com/client9/misspell
>>> If we can run this tool on CI, we can reduce the number of Pull Requests 
>>> just fixing typos.
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Ruby on Rails: Core" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to rubyonra...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/rubyonrails-core/cd70b713-02a1-4812-b6f8-01dbdfa7ce01%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> Richard Schneeman
>> https://www.schneems.com
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-core/eb29ae0b-0c1a-4de0-aefe-95a01f9952a9%40googlegroups.com.


[Rails-core] Proposal: make it clearer which persistence methods do callbacks/validations

2018-08-27 Thread Dana Sherson
Currently many of the persistence methods all have different behaviours 
when it comes to whether setters are called, and validations and or 
callbacks are run,
Knowing what happens requires deeper knowledge of rails than just reading 
the method name

This can be confusing for newcomers and even people very familiar with 
rails will need to double check which does what.

save(validate: false) => callbacks: yes, validations: no, 
only_save_mentioned_columns: N/A
save => callbacks: yes, validations: yes, touch: yes, 
only_save_mentioned_columns: N/A
save(touch: false) => callbacks: yes, validations: yes, touch: no, 
only_save_mentioned_columns: N/A
save(validate: false, touch: false) => callbacks: yes, validations: no, 
touch: no, only_save_mentioned_columns: N/A
update/update_attributes => callbacks: yes, validations: yes, setters: yes, 
touch: yes, only_save_mentioned_columns: no
update_columns/update_column => callbacks: no, validations: no, setters: 
no, touch: no, only_save_mentioned_columns: yes
update_attribute => callbacks: yes, validations: no, setters: yes, touch: 
yes, only_save_mentioned_columns: no
increment!/decrement!/toggle! => callbacks: no, validations: no, setters: 
no, touch: no, only_save_mentioned_columns: yes
increment!/decrement!(touch: true) => callbacks: no, validations: no, 
setters: no, touch: yes, only_save_mentioned_columns: yes
touch => callbacks: some, validations: no, setters: no, touch: yes, 
only_save_mentioned_columns: yes

update_all/Class update => callbacks: no, validations: no, setters: no, 
touch: no, only_save_mentioned_columns: yes

Proposal A: 

Follow what the `save` pattern started, and provide explicit instructions 
to update, and a more complete list to save

1. Add `callbacks: false` option to save.
2. Add `validate:`,`touch:`,`callbacks:`,`only_save_mentioned_columns:` to 
update, with the option of providing the instructions in a separate hash 
for models where those are columns/attributes
e.g. `update(column: whatever, callbacks: false)`, or `update(**params, 
callbacks: false)` or `update({ column: whatever }, callbacks: false)`, or 
`update(params, callbacks: false)`
3. deprecate the other update_* methods
4. always use attributes/setters. if one wants to not use the setters, 
don't use these pretty methods, and instead use []=/write_attribute and 
then save
5. only_save_mentioned_columns is a bad name, but I'm having difficulty 
thinking of a better one that's as clear
6. validate the keyword arguments passed to save/update, so people don't 
accidentally write 'skip_callbacks: true' or 'validates: false' or etc

Proposal B:

Rather than modifying update_*/save signatures, deprecate and replace with 
a method called `persist` and `persist!` that takes those options

I'd be happy to undertake the work of doing this PR if this is something 
you'd be interested in merging


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.