Skip to content
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

Merged
merged 61 commits into from Oct 9, 2015
Merged

Conversation

xithan
Copy link
Collaborator

@xithan xithan commented Sep 29, 2015

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

  • 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.

xithan added 14 commits July 15, 2015 16:18
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final newline missing.

Copy link
Collaborator Author

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

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)

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 }

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
Copy link
Collaborator

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...

@ethn ethn merged commit e676aac into wagn:master Oct 9, 2015
@xithan xithan deleted the listedby branch February 25, 2016 10:37
@xithan xithan restored the listedby branch February 25, 2016 10:37
@xithan xithan deleted the listedby branch February 25, 2016 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants