Class: InvitationForms::CreateCombo
- Inherits:
-
ApplicationForm
- Object
- ApplicationForm
- InvitationForms::CreateCombo
- Defined in:
- app/forms/simple_teams/invitation_forms/create_combo.rb
Instance Attribute Summary collapse
-
#accessible_emails ⇒ Object
Returns the value of attribute accessible_emails.
-
#current_user ⇒ Object
Returns the value of attribute current_user.
-
#email ⇒ Object
Returns the value of attribute email.
-
#emails ⇒ Object
Returns the value of attribute emails.
-
#form_instance ⇒ Object
Returns the value of attribute form_instance.
-
#role ⇒ Object
Returns the value of attribute role.
-
#select2_emails ⇒ Object
Returns the value of attribute select2_emails.
-
#single_vs_multiple ⇒ Object
Returns the value of attribute single_vs_multiple.
-
#team ⇒ Object
Returns the value of attribute team.
Instance Method Summary collapse
- #available_roles ⇒ Object
-
#initialize(team, current_user) ⇒ CreateCombo
constructor
A new instance of CreateCombo.
- #perform(params) ⇒ Object
Constructor Details
#initialize(team, current_user) ⇒ CreateCombo
Returns a new instance of CreateCombo.
6 7 8 9 |
# File 'app/forms/simple_teams/invitation_forms/create_combo.rb', line 6 def initialize(team, current_user) @team = team @current_user = current_user end |
Instance Attribute Details
#accessible_emails ⇒ Object
Returns the value of attribute accessible_emails.
4 5 6 |
# File 'app/forms/simple_teams/invitation_forms/create_combo.rb', line 4 def accessible_emails @accessible_emails end |
#current_user ⇒ Object
Returns the value of attribute current_user.
4 5 6 |
# File 'app/forms/simple_teams/invitation_forms/create_combo.rb', line 4 def current_user @current_user end |
#email ⇒ Object
Returns the value of attribute email.
4 5 6 |
# File 'app/forms/simple_teams/invitation_forms/create_combo.rb', line 4 def email @email end |
#emails ⇒ Object
Returns the value of attribute emails.
4 5 6 |
# File 'app/forms/simple_teams/invitation_forms/create_combo.rb', line 4 def emails @emails end |
#form_instance ⇒ Object
Returns the value of attribute form_instance.
4 5 6 |
# File 'app/forms/simple_teams/invitation_forms/create_combo.rb', line 4 def form_instance @form_instance end |
#role ⇒ Object
Returns the value of attribute role.
4 5 6 |
# File 'app/forms/simple_teams/invitation_forms/create_combo.rb', line 4 def role @role end |
#select2_emails ⇒ Object
Returns the value of attribute select2_emails.
4 5 6 |
# File 'app/forms/simple_teams/invitation_forms/create_combo.rb', line 4 def select2_emails @select2_emails end |
#single_vs_multiple ⇒ Object
Returns the value of attribute single_vs_multiple.
4 5 6 |
# File 'app/forms/simple_teams/invitation_forms/create_combo.rb', line 4 def single_vs_multiple @single_vs_multiple end |
#team ⇒ Object
Returns the value of attribute team.
4 5 6 |
# File 'app/forms/simple_teams/invitation_forms/create_combo.rb', line 4 def team @team end |
Instance Method Details
#available_roles ⇒ Object
30 31 32 |
# File 'app/forms/simple_teams/invitation_forms/create_combo.rb', line 30 def available_roles SimpleTeams::Membership.roles end |
#perform(params) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/forms/simple_teams/invitation_forms/create_combo.rb', line 11 def perform(params) # Store input self.assign_attributes(params) # Set form instance from input @form_instance = selected_form_klass.new(team, current_user) # Perform if form_instance.perform(filter_params(params)) return true else reassign_errors unless single? self.emails = form_instance.emails end false end end |