SequelモデルからSQLステートメントだけを取得する方法はありますか?
class Asset < Sequel::Model(:Asset)
set_primary_key :id
many_to_one :site, key: :siteid
many_to_one :company, key: :companyid
def validate
super
errors.add(:partnumber, "can't be empty") if partnumber.nil? || partnumber.empty?
errors.add(:serialnumber, "can't be empty") if serialnumber.nil? || serialnumber.empty?
errors.add(:description, "can't be empty") if description.nil? || description.empty?
end
end
asset = Asset.new
# Add values to asset
puts asset.insert_sql