Module: SimplePages::Models::PageUrl::ClassMethods

Defined in:
lib/simple_pages/models/page_url.rb

Instance Method Summary collapse

Instance Method Details

#find_or_create_by_url(attrs) ⇒ Object



13
14
15
16
# File 'lib/simple_pages/models/page_url.rb', line 13

def find_or_create_by_url(attrs)
  url = attrs.delete :url
  where(url: url).first_or_create(attrs)
end