Sha256: 87cfdb30a44b62d127503d4c14ceca52f1f7586f79e1e78051e2d0ca0ece24a3

Contents?: true

Size: 322 Bytes

Versions: 19

Compression:

Stored size: 322 Bytes

Contents

# Used for link-methods in Rails apps
class Baza::DatabaseModelName
  def initialize(instance)
    @instance = instance
  end

  def singular_route_key
    route_key = human.underscore
    route_key = "indexes" if route_key == "indices"
    route_key
  end

  def human
    @instance.class.name.split("::").last
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
baza-0.0.38 lib/baza/database_model_name.rb
baza-0.0.37 lib/baza/database_model_name.rb
baza-0.0.36 lib/baza/database_model_name.rb
baza-0.0.35 lib/baza/database_model_name.rb
baza-0.0.34 lib/baza/database_model_name.rb
baza-0.0.33 lib/baza/database_model_name.rb
baza-0.0.32 lib/baza/database_model_name.rb
baza-0.0.31 lib/baza/database_model_name.rb
baza-0.0.30 lib/baza/database_model_name.rb
baza-0.0.29 lib/baza/database_model_name.rb
baza-0.0.28 lib/baza/database_model_name.rb
baza-0.0.27 lib/baza/database_model_name.rb
baza-0.0.26 lib/baza/database_model_name.rb
baza-0.0.25 lib/baza/database_model_name.rb
baza-0.0.24 lib/baza/database_model_name.rb
baza-0.0.23 lib/baza/database_model_name.rb
baza-0.0.22 lib/baza/database_model_name.rb
baza-0.0.21 lib/baza/database_model_name.rb
baza-0.0.20 lib/baza/database_model_name.rb