Module: ZeroDowntimeMigrations::DSL
- Included in:
- Migration
- Defined in:
- lib/zero_downtime_migrations/dsl.rb
Instance Attribute Summary collapse
-
#current ⇒ Object
Returns the value of attribute current.
-
#data ⇒ Object
Returns the value of attribute data.
-
#ddl ⇒ Object
Returns the value of attribute ddl.
-
#index ⇒ Object
Returns the value of attribute index.
-
#safe ⇒ Object
Returns the value of attribute safe.
Instance Method Summary collapse
- #data? ⇒ Boolean
- #ddl? ⇒ Boolean
- #index? ⇒ Boolean
- #migrating? ⇒ Boolean
- #mixed? ⇒ Boolean
- #safe? ⇒ Boolean
- #safety_assured ⇒ Object
- #unsafe? ⇒ Boolean
Instance Attribute Details
#current ⇒ Object
Returns the value of attribute current.
3 4 5 |
# File 'lib/zero_downtime_migrations/dsl.rb', line 3 def current @current end |
#data ⇒ Object
Returns the value of attribute data.
3 4 5 |
# File 'lib/zero_downtime_migrations/dsl.rb', line 3 def data @data end |
#ddl ⇒ Object
Returns the value of attribute ddl.
3 4 5 |
# File 'lib/zero_downtime_migrations/dsl.rb', line 3 def ddl @ddl end |
#index ⇒ Object
Returns the value of attribute index.
3 4 5 |
# File 'lib/zero_downtime_migrations/dsl.rb', line 3 def index @index end |
#safe ⇒ Object
Returns the value of attribute safe.
3 4 5 |
# File 'lib/zero_downtime_migrations/dsl.rb', line 3 def safe @safe end |
Instance Method Details
#data? ⇒ Boolean
5 6 7 |
# File 'lib/zero_downtime_migrations/dsl.rb', line 5 def data? !!@data end |
#ddl? ⇒ Boolean
9 10 11 |
# File 'lib/zero_downtime_migrations/dsl.rb', line 9 def ddl? !!@ddl end |
#index? ⇒ Boolean
13 14 15 |
# File 'lib/zero_downtime_migrations/dsl.rb', line 13 def index? !!@index end |
#migrating? ⇒ Boolean
17 18 19 |
# File 'lib/zero_downtime_migrations/dsl.rb', line 17 def !!@current end |
#mixed? ⇒ Boolean
21 22 23 |
# File 'lib/zero_downtime_migrations/dsl.rb', line 21 def mixed? [data?, ddl?, index?].select(&:itself).size > 1 end |
#safe? ⇒ Boolean
25 26 27 |
# File 'lib/zero_downtime_migrations/dsl.rb', line 25 def safe? !!@safe || ENV["SAFETY_ASSURED"].presence end |
#safety_assured ⇒ Object
29 30 31 |
# File 'lib/zero_downtime_migrations/dsl.rb', line 29 def safety_assured Migration.safe = true end |
#unsafe? ⇒ Boolean
33 34 35 |
# File 'lib/zero_downtime_migrations/dsl.rb', line 33 def unsafe? !safe? end |