Module: Ext::Integrations::Organization
- Included in:
- Organization
- Defined in:
- app/models/ext/integrations.rb
Class Method Summary collapse
Instance Method Summary collapse
- #connected? ⇒ Boolean
- #fsp ⇒ Object
- #has_active_fiscally_sponsored_project? ⇒ Boolean
- #has_fiscally_sponsored_project? ⇒ Boolean
- #items_sold_as_reseller_during(date_range) ⇒ Object
- #name_for_donations ⇒ Object
- #refresh_active_fs_project ⇒ Object
- #shows_with_sales ⇒ Object
- #sponsored_kit ⇒ Object
- #update_kits ⇒ Object
Class Method Details
.included(base) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/models/ext/integrations.rb', line 20 def self.included(base) base.class_eval do after_create do [TicketingKit,RegularDonationKit].each do |klass| kit = klass.new kit.state = 'activated' kit.organization = self kit.save end end end end |
Instance Method Details
#connected? ⇒ Boolean
33 34 35 |
# File 'app/models/ext/integrations.rb', line 33 def connected? false end |
#fsp ⇒ Object
37 38 39 |
# File 'app/models/ext/integrations.rb', line 37 def fsp nil end |
#has_active_fiscally_sponsored_project? ⇒ Boolean
41 42 43 |
# File 'app/models/ext/integrations.rb', line 41 def has_active_fiscally_sponsored_project? false end |
#has_fiscally_sponsored_project? ⇒ Boolean
45 46 47 |
# File 'app/models/ext/integrations.rb', line 45 def has_fiscally_sponsored_project? false end |
#items_sold_as_reseller_during(date_range) ⇒ Object
52 53 54 |
# File 'app/models/ext/integrations.rb', line 52 def items_sold_as_reseller_during(date_range) [] end |
#name_for_donations ⇒ Object
56 57 58 |
# File 'app/models/ext/integrations.rb', line 56 def name_for_donations self.name end |
#refresh_active_fs_project ⇒ Object
49 50 |
# File 'app/models/ext/integrations.rb', line 49 def refresh_active_fs_project end |
#shows_with_sales ⇒ Object
67 68 69 70 71 72 73 74 75 |
# File 'app/models/ext/integrations.rb', line 67 def shows_with_sales standard = ::Order. includes(:items => { :show => :event }). where("orders.organization_id = ?", self.id). map { |o| o.items.map(&:show) } standard.flatten.compact.uniq.sort end |
#sponsored_kit ⇒ Object
63 64 65 |
# File 'app/models/ext/integrations.rb', line 63 def sponsored_kit nil end |
#update_kits ⇒ Object
60 61 |
# File 'app/models/ext/integrations.rb', line 60 def update_kits end |