Sha256: edb5178fc6b407b944737f88acf4381fc1a6c3cba48fed73b46a60a2c5a14cb2
Contents?: true
Size: 1.32 KB
Versions: 2
Compression:
Stored size: 1.32 KB
Contents
format :rss do def raw_feed_items _args [card] end end format :html do include AddHelp::HtmlFormat end event :update_structurees_references, before: :subsequent, when: proc { |c| c.db_content_changed? || c.action == :delete } do return unless (statement = structuree_statement) Auth.as_bot do Card::Query.run(statement).each(&:update_references) end end event :update_structurees_type, after: :store, changed: :type_id, when: proc { |c| c.assigns_type? } do update_structurees type_id: type_id end def structuree_names if (wql = structuree_statement) Auth.as_bot do Card::Query.run(wql.merge return: :name) end else [] end end def update_structurees args # note that this is not smart about overriding templating rules # for example, if someone were to change the type of a # +*right+*structure rule that was overridden # by a +*type plus right+*structure rule, the override would not be respected. statement = structuree_statement return unless statement Auth.as_bot do statement[:return] = :id Card::Query.run(statement).each_slice(100) do |id_batch| Card.where(id: id_batch).update_all args end end end def structuree_statement set_card = trunk return unless set_card.type_id == SetID set_card.get_query end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
card-1.17.1 | mod/04_settings/set/right/structure.rb |
card-1.17.0 | mod/04_settings/set/right/structure.rb |