Class: Clickwrap::SchemaRequirements::Feature
- Inherits:
-
Data
- Object
- Data
- Clickwrap::SchemaRequirements::Feature
- Defined in:
- lib/clickwrap/schema_requirements.rb
Instance Attribute Summary collapse
-
#because ⇒ Object
readonly
Returns the value of attribute because.
-
#flag ⇒ Object
readonly
Returns the value of attribute flag.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#tables ⇒ Object
readonly
Returns the value of attribute tables.
Instance Method Summary collapse
Instance Attribute Details
#because ⇒ Object (readonly)
Returns the value of attribute because
17 18 19 |
# File 'lib/clickwrap/schema_requirements.rb', line 17 def because @because end |
#flag ⇒ Object (readonly)
Returns the value of attribute flag
17 18 19 |
# File 'lib/clickwrap/schema_requirements.rb', line 17 def flag @flag end |
#key ⇒ Object (readonly)
Returns the value of attribute key
17 18 19 |
# File 'lib/clickwrap/schema_requirements.rb', line 17 def key @key end |
#tables ⇒ Object (readonly)
Returns the value of attribute tables
17 18 19 |
# File 'lib/clickwrap/schema_requirements.rb', line 17 def tables @tables end |
Instance Method Details
#explanation ⇒ Object
20 21 22 23 24 25 |
# File 'lib/clickwrap/schema_requirements.rb', line 20 def explanation "#{because} That needs #{"the" if tables.length == 1}" \ "#{tables.length == 1 ? " #{tables.first} table" : " tables #{tables.join(" and ")}"}, " \ "which this database does not have. Add #{tables.length == 1 ? "it" : "them"}:\n\n " \ "#{generator_command}\n bin/rails db:migrate" end |
#generator_command ⇒ Object
18 |
# File 'lib/clickwrap/schema_requirements.rb', line 18 def generator_command = "bin/rails generate clickwrap:install #{flag}" |