New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new subcards api and list/listed_by relations #513
Conversation
A way to establish has_many relations. The pattern is as follows: Let A,B be cards of type letter and 1,2 cards of type number. If you create list cards - A+numbers -> [[1]]\n[[2]] - B+numbers -> [[1]] then the following listed_by cards will contain the related letters: - 1+letters -> [[A]]\n[[B]] - 2+letters -> [[A]]] The content of listed_by cards is cached and gets updated after every change on a related list card.
Conflicts: card/lib/card/set.rb card/mod/01_core/set/all/phases.rb card/mod/01_core/set/all/tracked_attributes.rb card/mod/01_core/spec/set/all/tracked_attributes_spec.rb card/mod/02_basic_types/set/all/base.rb card/mod/05_standard/set/abstract/attachment.rb card/mod/05_standard/set/right/account.rb card/mod/05_standard/set/self/navbox.rb card/mod/05_standard/set/self/signin.rb card/mod/05_standard/set/type/signup.rb card/mod/05_standard/set/type/user.rb card/mod/05_standard/spec/set/all/account_spec.rb
# | ||
# end | ||
|
||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final newline missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why the wagn logo changed. I'll restore the old version.
it 'reader setting' do | ||
Card.where(trash: false).each do |ca| | ||
rule_card, rule_class = ca.permission_rule_card(:read) | ||
# warn "C #{c.inspect}, #{c.read_rule_id}, #{prc.first.id}, #{c.read_rule_class}, #{prc.second}, #{prc.first.inspect}" unless prc.last == c.read_rule_class && prc.first.id == c.read_rule_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [197/80]
if name && t=template | ||
reset_patterns #still necessary even with new template handling? | ||
def get_type_id_from_structure | ||
if name && (t = template) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a guard clause instead of wrapping the code inside a conditional expression.
before do | ||
@card = Card['A'] | ||
end | ||
subject { Card.fetch("#{@card.name}+sub", new: {}, local_only: true).content } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [82/80]
@@ -102,14 +102,14 @@ Style/CollectionMethods: | |||
PreferredMethods: | |||
collect: map | |||
collect!: map! | |||
find: detect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice thing about detect is that you wouldn't confuse it with ActiveRecord#find...
The "list" and "listed by" cardtypes provide a way to establish many-to-many relationships. The pattern is as follows:
Let A,B be cards of type letter and 1,2 cards of type number.
If you create list cards
then the following listed by cards will contain the related letters:
The content of listed by cards is cached and gets updated after every change on a related list card.